VTS Posted June 8, 2007 Share Posted June 8, 2007 Is there any way in PHP to add a comma to a variable that will have a total in it. For instance, if $total = 100+999. How can I get that field to have a comma in the right place? thanks VTS Quote Link to comment https://forums.phpfreaks.com/topic/54747-solved-number-formatting-adding-a-comma/ Share on other sites More sharing options...
pikemsu28 Posted June 8, 2007 Share Posted June 8, 2007 $total = number_format($number); this will add commas between every group of thousands http://www.php.net/manual/en/function.number-format.php Quote Link to comment https://forums.phpfreaks.com/topic/54747-solved-number-formatting-adding-a-comma/#findComment-270759 Share on other sites More sharing options...
VTS Posted June 8, 2007 Author Share Posted June 8, 2007 Thanks for the quick reply Quote Link to comment https://forums.phpfreaks.com/topic/54747-solved-number-formatting-adding-a-comma/#findComment-270770 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.