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 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 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 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
Archived
This topic is now archived and is closed to further replies.