Subject Re: [ib-support] Float, Numeric or Other
Author Thomas Miller
Kumar wrote:

>In our DBISAM app, we mistakenly used floats all over the place where the field was really holding currency values.
>
>1.What would be the recommended DataType to hold "good old dollars and cents" in FB?
>
NUMERIC

>2. It appears that a numeric(12,2) would handle any single amount that we would come across...but does it have any issues when running a query who's sum would be more like 15,2 ?
>
If you do any foreign currency, then you need to allow for 6 decimal
places. I would recommend NUMERIC(18,6)

>3. Since we did use floats in the beginning, our client app is careful about rounding everything before posting. Is there any downside to leaving these fields as floats?
>
Yes. Expect any time you do a SUM on a column to get a rounding error.

>
>Thanks again and again,
>Kumar Manuel
>
>
>
>[Non-text portions of this message have been removed]
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>

--
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork

http://www.bss-software.com
http://sourceforge.net/projects/dbexpressplus