fpc/tests/webtbs/tw13076.pp
Jonas Maebe 9804fd527b * don't add a thousands separator in FormatFloat if there are no digits
before it because the value is too small, regardless of what the format
   pattern sepcifies (patch by Bart Broersma, mantis #13076)

git-svn-id: trunk@23095 -
2012-12-02 16:57:41 +00:00

29 lines
419 B
ObjectPascal

{$ifdef fpc}
{$mode objfpc}
{$endif}
program tw12385;
uses
SysUtils;
var
s: string;
cr: Extended;
Procedure TestIt(CR : Extended; Fmt,Expected : String);
begin
S:=FormatFloat(Fmt,cr);
If S<>Expected then
begin
Writeln('"',S,'"<>"',Expected,'" (latter is correct)');
Halt(1);
end;
end;
begin
DecimalSeparator:='.';
ThousandSeparator:=',';
TestIt(-10,'###,###,##0.00','-10.00');
end.