* fixed type in FloatToStrFIntl introduced in r23311 (mantis #24131)

git-svn-id: trunk@24013 -
This commit is contained in:
Jonas Maebe 2013-03-26 18:53:37 +00:00
parent 262593c571
commit 7dfe1301c3
3 changed files with 34 additions and 1 deletions

1
.gitattributes vendored
View File

@ -13288,6 +13288,7 @@ tests/webtbs/tw23962.pp svneol=native#text/plain
tests/webtbs/tw2397.pp svneol=native#text/plain
tests/webtbs/tw24007.pp svneol=native#text/plain
tests/webtbs/tw2409.pp svneol=native#text/plain
tests/webtbs/tw24131.pp svneol=native#text/plain
tests/webtbs/tw2421.pp svneol=native#text/plain
tests/webtbs/tw2423.pp svneol=native#text/plain
tests/webtbs/tw2425.pp svneol=native#text/plain

View File

@ -1205,7 +1205,7 @@ Begin
fvDouble:
Str(Double(Extended(Aligned(Value))):precision+7, Result);
fvSingle:
Str(Single(Extended(Aligned(Value))):precision+66, Result);
Str(Single(Extended(Aligned(Value))):precision+6, Result);
fvCurrency:
{$ifdef FPC_HAS_STR_CURRENCY}
Str(Currency(Aligned(Value)):precision+6, Result);

32
tests/webtbs/tw24131.pp Normal file
View File

@ -0,0 +1,32 @@
uses
SysUtils;
var
s: single;
begin
s := 1.00999;
FormatSettings.DecimalSeparator:='.';
writeln(FloatToStrF(s, ffGeneral, 8, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 7, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 6, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 5, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 4, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 3, 0, FormatSettings));
writeln(FloatToStrF(s, ffGeneral, 2, 0, FormatSettings));
if FloatToStrF(s, ffGeneral, 8, 0, FormatSettings)<>'1.00999' then
halt(1);
if FloatToStrF(s, ffGeneral, 7, 0, FormatSettings)<>'1.00999' then
halt(2);
if FloatToStrF(s, ffGeneral, 6, 0, FormatSettings)<>'1.00999' then
halt(3);
if FloatToStrF(s, ffGeneral, 5, 0, FormatSettings)<>'1.01' then
halt(4);
if FloatToStrF(s, ffGeneral, 4, 0, FormatSettings)<>'1.01' then
halt(5);
if FloatToStrF(s, ffGeneral, 3, 0, FormatSettings)<>'1.01' then
halt(6);
if FloatToStrF(s, ffGeneral, 2, 0, FormatSettings)<>'1' then
halt(7);
end.