mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-27 23:42:38 +02:00
* fixed type in FloatToStrFIntl introduced in r23311 (mantis #24131)
git-svn-id: trunk@24013 -
This commit is contained in:
parent
262593c571
commit
7dfe1301c3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
32
tests/webtbs/tw24131.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user