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 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); ?> 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 Link to comment https://forums.phpfreaks.com/topic/163226-solved-decimal-places/#findComment-861216 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.