spires Posted June 22, 2009 Share Posted June 22, 2009 Hi guys I want to turn a 1000 into 1,000.00 How is this done using php? Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/163226-solved-decimal-places/ Share on other sites More sharing options...
gevans Posted June 22, 2009 Share Posted June 22, 2009 Take a look at number_format() http://us.php.net/manual/en/function.number-format.php for example, the following will give you your desired result; <?php $foo = 1000; echo number_format($foo, 2); ?> Quote Link to comment https://forums.phpfreaks.com/topic/163226-solved-decimal-places/#findComment-861209 Share on other sites More sharing options...
spires Posted June 22, 2009 Author Share Posted June 22, 2009 That's excellent Thanks Quote Link to comment https://forums.phpfreaks.com/topic/163226-solved-decimal-places/#findComment-861216 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.