Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Best Datatype for Money columns?

Re: Best Datatype for Money columns?

From: Mark D Powell <mark.powellNOmaSPAM_at_eds.com.invalid>
Date: 2000/08/10
Message-ID: <0057b348.8098e325@usw-ex0102-015.remarq.com>#1/1

Stefan Roesch <Stefan.Roesch_at_t-online.de> wrote:
>shirleyk wrote:
>
>> Are there best practices for storing money in an Oracle
>> Database? I've been using number(38,2), but now I'm
 interfacing
>> with a system where money columns have been defined as float.
>> I've done some tests, and haven't seen any rounding errors
 yet,
>> but does anybody have any advice?
>>
>> Thanks,
>>
>> -----------------------------------------------------------
>>
>Floats are internally converted to the number datatype
>Stefan
>
>

Number(N,d) where N = number of digits and d = number of digits to right of decimal are the best way to store currency amounts.

You can use the to_char(N,'format') to display them anyway you want, i.e., $99,000.00, and by using nls_parameters you can substitute foreign symbols in the proper spots such as %99.000,00 where % is a foreign currency symbol and a dot is used as the group separator and a comma for the decimal. The format mask symbols are in the SQL manual.

Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free!
http://www.keen.com Received on Thu Aug 10 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US