From 193c7af57ff5f39736ec0dc932449e2adca4a89e Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 26 Aug 2012 14:51:32 +0000 Subject: [PATCH] * print literal e/E in formatfloat if not followed by +/- (remaining part of mantis #22290) git-svn-id: trunk@22248 - --- .gitattributes | 1 + rtl/objpas/sysutils/sysstr.inc | 6 +++++- tests/webtbs/tw22290.pp | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw22290.pp diff --git a/.gitattributes b/.gitattributes index dfe2758e46..cef2d12090 100644 --- a/.gitattributes +++ b/.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 diff --git a/rtl/objpas/sysutils/sysstr.inc b/rtl/objpas/sysutils/sysstr.inc index b3c61e68ad..ad1fae25ab 100644 --- a/rtl/objpas/sysutils/sysstr.inc +++ b/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); diff --git a/tests/webtbs/tw22290.pp b/tests/webtbs/tw22290.pp new file mode 100644 index 0000000000..2a9e613da5 --- /dev/null +++ b/tests/webtbs/tw22290.pp @@ -0,0 +1,7 @@ +uses + SysUtils; + +begin + if formatfloat('0e',-1)<>'-1e' then + halt(1); +end.