If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Number type for currency

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-04, 10:42
krz krz is offline
Registered User
 
Join Date: Nov 2004
Posts: 25
Number type for currency

does mysql have an equivalent to Oracle's NUMBER(6,2) ?
for example: NUMBER(5,2) can output 12000.40
it will round to the hundredth

in mysql whats the best type to store currency type digits, like: 80.99 Im thinking of using Decimal. Im really unsure. would anyone like to help me out on this one
Reply With Quote
  #2 (permalink)  
Old 11-10-04, 18:10
JohnStrecker JohnStrecker is offline
Registered User
 
Join Date: Sep 2004
Posts: 39
Hi

I would use decimal.

As for rounding say you need to round 123456 / 999 to the hundreth I would do

round(123456 / 999 *100) /100

You should get 123.58

Have fun
One line at a time
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On