chaiwei Posted November 27, 2008 Share Posted November 27, 2008 Hi all, I got a variable, $value=number_format((math calculation) ,2) which get the value // 46,000.29 mydatabase column to store this value is decimal (10,2) But i when the time I insert in database,it only stored 46.00 it is because the , problem. I try to remove the , by manually and insert the 46000.29 It works. It stored exactly the value. What should I do. Link to comment https://forums.phpfreaks.com/topic/134488-solved-help-insert-into-database-problem/ Share on other sites More sharing options...
Mchl Posted November 27, 2008 Share Posted November 27, 2008 Remove the , Use str_replace or use number format without thousands separator Link to comment https://forums.phpfreaks.com/topic/134488-solved-help-insert-into-database-problem/#findComment-700280 Share on other sites More sharing options...
chaiwei Posted November 27, 2008 Author Share Posted November 27, 2008 Hi Mchl, thanks for your guide, I know how to solve already. $value=number_format($value,2,'.',''); //46000.29 without the thousand seperator. Link to comment https://forums.phpfreaks.com/topic/134488-solved-help-insert-into-database-problem/#findComment-700282 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.