* don't insert thousandseparator if it is #0 (mantis #13552, patch by

Jesus Reyes)

git-svn-id: trunk@13028 -
This commit is contained in:
Jonas Maebe 2009-04-23 19:16:49 +00:00
parent 10158da60e
commit e8edc31a89
3 changed files with 19 additions and 3 deletions

1
.gitattributes vendored
View File

@ -8823,6 +8823,7 @@ tests/webtbs/tw13456.pp svneol=native#text/plain
tests/webtbs/tw1348.pp svneol=native#text/plain
tests/webtbs/tw1351.pp svneol=native#text/plain
tests/webtbs/tw13536.pp svneol=native#text/plain
tests/webtbs/tw13552.pp svneol=native#text/plain
tests/webtbs/tw13553.pp svneol=native#text/plain
tests/webtbs/tw13563.pp svneol=native#text/plain
tests/webtbs/tw1364.pp svneol=native#text/plain

View File

@ -1369,7 +1369,8 @@ Begin
Dec(P, 3);
While (P > 1) Do
Begin
If Result[P - 1] <> '-' Then Insert(FormatSettings.ThousandSeparator, Result, P);
If (Result[P - 1] <> '-') And (FormatSettings.ThousandSeparator <> #0) Then
Insert(FormatSettings.ThousandSeparator, Result, P);
Dec(P, 3);
End;
End;
@ -1401,7 +1402,8 @@ Begin
Dec(P, 3);
While (P > 1) Do
Begin
Insert(FormatSettings.ThousandSeparator, Result, P);
If FormatSettings.ThousandSeparator<>#0 Then
Insert(FormatSettings.ThousandSeparator, Result, P);
Dec(P, 3);
End;
@ -1954,7 +1956,7 @@ Var
End;
',':
Begin
thousand := True;
thousand := DefaultFormatSettings.ThousandSeparator<>#0;
Inc(Fmt);
End;
'e', 'E':

13
tests/webtbs/tw13552.pp Normal file
View File

@ -0,0 +1,13 @@
uses
sysutils;
var
s: ansistring;
begin
ThousandSeparator:=#0;
DecimalSeparator:='.';
s:=formatfloat('#,0.00',1000.0);
writeln(s);
if (s<>'1000.00') then
halt(1);
end.