bschultz Posted June 25, 2009 Share Posted June 25, 2009 I have a query that get the sum of a column. The sum is over 14,000...but displays 14000. How can I add a comma so it echo's 14,000 (with the comma)? Quote Link to comment https://forums.phpfreaks.com/topic/163585-solved-sum-and-commas/ Share on other sites More sharing options...
rhodesa Posted June 25, 2009 Share Posted June 25, 2009 with MySQL...not really sure, but what are you using to display the output? If you are using PHP, then check out http://php.net/number_format Quote Link to comment https://forums.phpfreaks.com/topic/163585-solved-sum-and-commas/#findComment-863174 Share on other sites More sharing options...
Ken2k7 Posted June 25, 2009 Share Posted June 25, 2009 MySQL has a FORMAT function. SELECT FORMAT(num, 2) AS number FROM table; Quote Link to comment https://forums.phpfreaks.com/topic/163585-solved-sum-and-commas/#findComment-863179 Share on other sites More sharing options...
bschultz Posted June 25, 2009 Author Share Posted June 25, 2009 thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/163585-solved-sum-and-commas/#findComment-863483 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.