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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/155020-decimal-points/#findComment-815350 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.