dreamwest Posted April 21, 2009 Share Posted April 21, 2009 I kow nuber format can seperate numbers by thousands but how can i get a decimal point? number_format(54634) becomes: 54,634 But i also need decimals as well Example number: 5463454 what im looking for is 54,634.54 Link to comment https://forums.phpfreaks.com/topic/155020-decimal-points/ Share on other sites More sharing options...
kenrbnsn Posted April 21, 2009 Share Posted April 21, 2009 You need to divide by 100 before doing the number format: <?php $num = 5463454; echo number_format($num/100,2); ?> Ken Link to comment https://forums.phpfreaks.com/topic/155020-decimal-points/#findComment-815350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.