Browse Source

* print literal e/E in formatfloat if not followed by +/- (remaining part of
mantis #22290)

git-svn-id: trunk@22248 -

Jonas Maebe 13 years ago
parent
commit
193c7af57f
3 changed files with 13 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 5 1
      rtl/objpas/sysutils/sysstr.inc
  3. 7 0
      tests/webtbs/tw22290.pp

+ 1 - 0
.gitattributes

@@ -12789,6 +12789,7 @@ tests/webtbs/tw22154.pp svneol=native#text/pascal
 tests/webtbs/tw2220.pp svneol=native#text/plain
 tests/webtbs/tw2226.pp svneol=native#text/plain
 tests/webtbs/tw2229.pp svneol=native#text/plain
+tests/webtbs/tw22290.pp svneol=native#text/plain
 tests/webtbs/tw22320.pp svneol=native#text/plain
 tests/webtbs/tw22326.pp svneol=native#text/plain
 tests/webtbs/tw22329.pp svneol=native#text/pascal

+ 5 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -2064,7 +2064,11 @@ Var
                       Inc(Fmt);
                       End;
                     End;
-                  End;
+                  End
+                Else
+                  { just e/E without subsequent +/- -> not exponential format,
+                    but we have to simply print e/E literally }
+                  ExpFmt:=0;
                 End
               Else
                 Inc(Fmt);

+ 7 - 0
tests/webtbs/tw22290.pp

@@ -0,0 +1,7 @@
+uses
+  SysUtils;
+
+begin
+  if formatfloat('0e',-1)<>'-1e' then
+    halt(1);
+end.