mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 13:59:47 +02:00
parent
ecf4aa7f55
commit
63abaeecea
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8276,6 +8276,7 @@ tests/webtbs/tw11255.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11288.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11290.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11308.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11309.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11312.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1132.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1133.pp svneol=native#text/plain
|
||||
|
43
tests/webtbs/tw11309.pp
Normal file
43
tests/webtbs/tw11309.pp
Normal file
@ -0,0 +1,43 @@
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
|
||||
uses
|
||||
SysUtils;
|
||||
|
||||
const
|
||||
csMoney = '58.195';
|
||||
|
||||
Function Format_Currency_String1(sMoney : string) : string;
|
||||
var
|
||||
aCurrency : Currency;
|
||||
begin
|
||||
TRY
|
||||
aCurrency := strtoCurr(sMoney);
|
||||
EXCEPT
|
||||
on E: EConvertError do aCurrency := 0;
|
||||
END;
|
||||
//result := CurrToStrF(currBetrag,ffFixed,2);
|
||||
result := FloatToStrF(aCurrency,ffFixed,19,2);
|
||||
end;
|
||||
|
||||
Function Format_Currency_String2(sMoney : string) : string;
|
||||
var
|
||||
aCurrency : real;
|
||||
begin
|
||||
TRY
|
||||
aCurrency := strtofloat(sMoney);
|
||||
EXCEPT
|
||||
on E: EConvertError do aCurrency := 0;
|
||||
END;
|
||||
result := FloatToStrF(aCurrency,ffFixed,19,2);
|
||||
end;
|
||||
|
||||
begin
|
||||
writeln(Format_Currency_String1(csMoney));
|
||||
writeln(Format_Currency_String2(csMoney));
|
||||
if Format_Currency_String1(csMoney)<>'58.20' then
|
||||
halt(1);
|
||||
if Format_Currency_String2(csMoney)<>'58.20' then
|
||||
halt(2);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user