geroido Posted July 23, 2008 Share Posted July 23, 2008 Hi Can anyone tell me what data type I should use in my table to insert proper currency values. Everytime I enter a value like 19.99, mysql rounds it to 20 which I don't want. Link to comment https://forums.phpfreaks.com/topic/116247-solved-mysql-is-rounding-up-my-currency-values-problem/ Share on other sites More sharing options...
paul2463 Posted July 23, 2008 Share Posted July 23, 2008 if the column was float(6,2) that should do it for you Link to comment https://forums.phpfreaks.com/topic/116247-solved-mysql-is-rounding-up-my-currency-values-problem/#findComment-597726 Share on other sites More sharing options...
accident Posted July 23, 2008 Share Posted July 23, 2008 actually use decimal, never use float for currency. So for example decimal(10,2) Link to comment https://forums.phpfreaks.com/topic/116247-solved-mysql-is-rounding-up-my-currency-values-problem/#findComment-597766 Share on other sites More sharing options...
geroido Posted July 23, 2008 Author Share Posted July 23, 2008 Thanks The data type was Decimal but had 10,0 in it as default. Works great now. Much appreciated. Link to comment https://forums.phpfreaks.com/topic/116247-solved-mysql-is-rounding-up-my-currency-values-problem/#findComment-597774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.