Gossamer Forum
Home : General : Databases and SQL :

Currency and MySQL, how do you do it?

Quote Reply
Currency and MySQL, how do you do it?
Ive got a mysql database field and i wanna set it to decimal 10,2 but it wont let me, it keeps changing it back to 10,0 and i want to import from an access database a table that has a couple of fields of currency values with 2 decimal places. How can i import these currency values into mysql without it rounding off the figures to whole dollars? currently after i import them it rounds them off and i cant work out how to stop the rounding. I also have to use this field for calculations later on so i need decimals.

later..

Last edited by:

TheIceman: Oct 9, 2002, 4:45 AM
Quote Reply
Re: [TheIceman] Currency and MySQL, how do you do it? In reply to
Does it set it to 2 d.p to start with? Or does it just say it was successful? I had a problem with this a while back, and it was the fact I was using an INT field by accident Crazy

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [TheIceman] Currency and MySQL, how do you do it? In reply to
What type of column are you using?
Quote Reply
Re: [Andy] Currency and MySQL, how do you do it? In reply to
i just noticed phpmyadmin keeps setting the field to 10,0 when i tell it to do 10,2. I tried running the sql manually and it worked, it set it to 10,2. I will now try importing the data back into it and see if it will work.
Quote Reply
Re: [TheIceman] Currency and MySQL, how do you do it? In reply to
yep fixed it, just had to set the field up manually with sql instead of using phpmyadmin to do it. thanks.