On 5/30/07, Yury Sidorov <[EMAIL PROTECTED]> wrote:
> Yeah, that outputs the correct value here as well. Confirmed a bug
> then!
Currency to string conversion is handled in other way that float
types. In original example extended type was used....
Yury, you are right! I never spotted that, thanks.
Running the example program below shows the difference in output. The
currency type rounds to 0.01 and the extended type rounds to 0.00.
Either way, I still believe this is a bug in FormatFloat.
Test system is a Intel Pentium 4 processor running Windows 2000 and Linux.
-----------------------------------------------------------
program Project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ add your units here };
var
c: currency;
e: extended;
begin
c:=0.005;
e:= 0.005;
writeln(c:0:2);
writeln(e:0:2);
end.
-----------------------------------------------------------
--
Graeme Geldenhuys
General error, hit any user to continue.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel