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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.