mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 19:08:15 +02:00
fcl-js: less hints
This commit is contained in:
parent
6f8e71cb87
commit
b84d32fe04
@ -283,6 +283,14 @@ begin
|
||||
// conversion magic
|
||||
SetCodePage(RawByteString(Result), CP_ACP, False);
|
||||
end;
|
||||
|
||||
{$ifndef FPC_DOTTEDUNITS}
|
||||
function LeftStr(const s: UnicodeString; Count: SizeInt): UnicodeString; overload;
|
||||
begin
|
||||
Result:=copy(s,1,Count);
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{$endif}
|
||||
|
||||
function QuoteJSString(const S: TJSString; Quote: TJSChar): TJSString;
|
||||
@ -813,7 +821,7 @@ begin
|
||||
val(copy(S,i+1,length(S)),Exp,Code);
|
||||
if Code=0 then
|
||||
begin
|
||||
S2:='1E'+IntToStr(Exp+1);
|
||||
S2:='1E'+TJSString(IntToStr(Exp+1));
|
||||
if S[1]='-' then
|
||||
S2:='-'+S2;
|
||||
end;
|
||||
@ -853,7 +861,7 @@ begin
|
||||
Delete(S,length(S),1);
|
||||
if S[length(S)]='.' then
|
||||
Delete(S,length(S),1);
|
||||
S2:=S+'E'+IntToStr(Exp);
|
||||
S2:=S+'E'+TJSString(IntToStr(Exp));
|
||||
j:=Pos('.',S);
|
||||
if j>0 then
|
||||
begin
|
||||
@ -900,7 +908,7 @@ begin
|
||||
else
|
||||
begin
|
||||
// e.g. 1.1E+0010 -> 1.1E10
|
||||
S:=LeftStr(S,i)+IntToStr(Exp);
|
||||
S:=LeftStr(S,i)+TJSString(IntToStr(Exp));
|
||||
if (i >= 4) and (s[i-1] = '0') and (s[i-2] = '.') then
|
||||
// e.g. 1.0E22 -> 1E22
|
||||
Delete(S, i-2, 2);
|
||||
@ -976,7 +984,7 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
OldParams:=FD.Params;
|
||||
OldParams:=FD.{%H-}Params;
|
||||
For I:=0 to OldParams.Count-1 do
|
||||
begin
|
||||
write(OldParams[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user