Browse Source

fcl-js: write 1.20E1 as 1.2E1

git-svn-id: trunk@41387 -
Mattias Gaertner 6 năm trước cách đây
mục cha
commit
8569bd2bf6
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      packages/fcl-js/src/jswriter.pp

+ 9 - 0
packages/fcl-js/src/jswriter.pp

@@ -803,6 +803,15 @@ begin
             if (Code=0) and (D=AsNumber) then
               S:=S2;
             end;
+          else
+            if s[i-1]='0' then
+              begin
+              // 1.2340E...
+              S2:=LeftStr(S,i-2)+copy(S,i,length(S));
+              val(S2,D,Code);
+              if (Code=0) and (D=AsNumber) then
+                S:=S2;
+              end;
           end;
           end;
         // chomp default exponent E+000