iceblox Posted August 14, 2008 Share Posted August 14, 2008 Hi Guys, Apologies if I have put this under the wrong section.. But I have a script and lets say that it prints the number output of 139.95 when it gets uploaded to mysql it gets rounded up to 140.00 i thought that the type had to be float but this hasnt fixed it. Does anyone have any idea, what might be the issue? Cheers, Phil Link to comment https://forums.phpfreaks.com/topic/119687-solved-money-formats/ Share on other sites More sharing options...
obsidian Posted August 14, 2008 Share Posted August 14, 2008 What is your actual definition of the float column? For currency, I usually will use FLOAT(6, 2) where the "2" is the number of decimal precision you wish to store. Link to comment https://forums.phpfreaks.com/topic/119687-solved-money-formats/#findComment-616603 Share on other sites More sharing options...
iceblox Posted August 14, 2008 Author Share Posted August 14, 2008 Ah, yea that did it! Thanks, obsidian. I set it as Float but forgot the 6,2 part. Silly me lol Thanks again Link to comment https://forums.phpfreaks.com/topic/119687-solved-money-formats/#findComment-616626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.