+ test for already fixed mantis #11309

git-svn-id: trunk@11026 -
This commit is contained in:
Jonas Maebe 2008-05-21 17:06:41 +00:00
parent ecf4aa7f55
commit 63abaeecea
2 changed files with 44 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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
View 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.