Board index » delphi » Numeric for money fields?

Numeric for money fields?

I read somewhere in this NG that Numeric(15,6) is best for currency fields.
Is that better than using Float or Double Precision?

Tove

 

Re:Numeric for money fields?


Quote
Tove wrote:

> I read somewhere in this NG that Numeric(15,6) is best for currency fields.
> Is that better than using Float or Double Precision?

        In general, yes, an exact decimal number is a better choice for
currency than a floating point number (as the latter are subject to
rounding errors).  However, unless your currency has four digits of
decimals, you probably don't need six digits of precision.  It depends
upon what you'll be storing.   Here's a good reference for determining
how much precision you need:

http://efd.home.mindspring.com/acc101.htm

        HTH,

        -Craig

--
Craig Stuntz               Vertex Systems Corporation
Senior Developer           http://www.vertexsoftware.com

Delphi/InterBase weblog:   http://delphi.weblogs.com

Re:Numeric for money fields?


See "Using InterBase Data Types - by Borland Developer Support Staff" at
http://community.borland.com/article/0,1410,25914,00.html

Gabriel

Quote
"Tove" <t...@i-design.no> wrote in message

news:97aj1b$bug3@bornews.inprise.com...
Quote
> I read somewhere in this NG that Numeric(15,6) is best for currency
fields.
> Is that better than using Float or Double Precision?

> Tove

Other Threads