From e5771ad08451fbf95ed6fe93817ab0c8ec644cb2 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 24 Nov 2009 18:36:57 +0000 Subject: [PATCH] Do not add thousand separators to zerofilled numbers --- source/helpers.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/helpers.pas b/source/helpers.pas index a64f7675..ff859449 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -1845,11 +1845,15 @@ var begin Result := str; Result := StringReplace(Result, '.', DecimalSeparator, [rfReplaceAll]); + // Do not add thousand separators to zerofilled numbers + if ((Length(Result) >= 1) and (Result[1] = '0')) + or ((Length(Result) >= 1) and (Result[1] = '-') and (Result[1] = '0')) then + Exit; p := Pos(DecimalSeparator, Result); if p = 0 then p := Length(Result)+1; Left := 2; if (Length(Result) >= 1) and (Result[1] = '-') then - Left := 3; + Left := 3; if p > 0 then for i:=p-1 downto Left do begin if (p-i) mod 3 = 0 then Insert(ThousandSeparator, Result, i);