Subject Re: Monetary - Numeric(18,2) AsCurrency/AsExtended
Author Marco Menardi
As general roule, you should always use "currency" type since they are stor=
ed as scaled integer, so without rounding problems.
This is a complicate subject, since Delphi and Interbase has internal diffe=
rences that sometime, expecially at the extreme of the range, could cause so=
me accuracy problems, so IBO code "tried to to it's best" to make things go =
smmotly, and sometime does some "strange" conversions (to/from string...). S=
o watching at IBO internal code you could get a little confused, but I thing=
that with "AsCurrency" you will have the best monetary accurancy that Delph=
i/Interbase can give you.
On www.ibobjects,com there is a Tech Sheet "Working with Currency and Scale=
d Numeric Data Types" that could help you.
regards
Marco Menardi


--- In IBObjects@y..., "Martin D. Berezaga" <mdberezaga@y...> wrote:
> I'm using Numeric(18,2) to Monetary fields. To set/get these values in
> code, what's the best alternative to avoid rounding problems?
>
> IB_Query.FieldByName('MonetaryField').AsCurrency or
> IB_Query.FieldByName('MonetaryField').AsExtended ?
>
> Thanks.
>
> ---------------------------
> Martin D. Berezaga
> mdberezaga@y...
> ICQ : 18537142
> Porto Alegre - RS - Brasil
> ---------------------------
>
> _______________________________________________________________________
> Yahoo! GeoCities
> Tudo para criar o seu site: ferramentas fáceis de usar, espaço de sobra e=
acessórios.
> http://br.geocities.yahoo.com/