frank_solo Posted May 24, 2013 Share Posted May 24, 2013 I'm already using number_format() it shows the commas but for a number like 1500.53 the 1500 becomes 1,500 but the .53 disappears. Is there a better way? Link to comment https://forums.phpfreaks.com/topic/278354-formatting-numbers-to-show-commas-and-decimal-points/ Share on other sites More sharing options...
Love2c0de Posted May 24, 2013 Share Posted May 24, 2013 Good afternoon, Try this code: $number = 1234.56; $english_format_number = number_format($number, 2, '.', ','); print($english_format_number); Read this page here: http://php.net/manual/en/function.number-format.php Kind regards, L2c. Link to comment https://forums.phpfreaks.com/topic/278354-formatting-numbers-to-show-commas-and-decimal-points/#findComment-1432090 Share on other sites More sharing options...
frank_solo Posted May 24, 2013 Author Share Posted May 24, 2013 Yup that did the trick, Thanks Love2code Link to comment https://forums.phpfreaks.com/topic/278354-formatting-numbers-to-show-commas-and-decimal-points/#findComment-1432092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.