[fpc-pascal] Currency and ABS(-674.59)

Martin Schreiber mse00000 at gmail.com
Wed Mar 7 08:51:03 CET 2012


On Tuesday, 6. March 2012 14.13:17 Ludo Brands wrote:
> >
> > No, Currency is based on Extended on i386 and x86_64 (except win64!).
> >
>
> There is also a lot of code in the rtl and fcl-db that supposes currency =
> double. Fe.
>
> Function CurrToStr(Value: Currency; Const FormatSettings: TFormatSettings):
> string;
> begin
>   Result:=FloatToStrF(Value,ffGeneral,-1,0,FormatSettings);
> end;
>
> Or
>
> TCurrencyField = class(TFloatField)
>
TCurrencyField datatype is double. The difference to TFloatField is 
the "GetText" formatting where currency formatting of the current locale will 
be used instead of float formatting AFAIK. The TField class with currency 
datatype is TBCDField.

Martin



More information about the fpc-pascal mailing list