Ninjakreborn Posted February 19, 2007 Share Posted February 19, 2007 Is there a relatively easy way (one built in function), that does nothing else but put commas for longer numbers. Like it would automatically make 3999 => 3,999 25000 => 25,000 7000000000 => 7,000,000,000 I am hoping for a quick fix, if I set down a minute I could do it anyway with some longer way. just checking if there is a built in function that does this instead. Quote Link to comment https://forums.phpfreaks.com/topic/39215-solved-decimals/ Share on other sites More sharing options...
JBS103 Posted February 19, 2007 Share Posted February 19, 2007 Try this: http://us2.php.net/manual/en/function.number-format.php Quote Link to comment https://forums.phpfreaks.com/topic/39215-solved-decimals/#findComment-188928 Share on other sites More sharing options...
pocobueno1388 Posted February 19, 2007 Share Posted February 19, 2007 <?php $number = 500000; $new_number = number_format($number); ?> That should give you what you want. Quote Link to comment https://forums.phpfreaks.com/topic/39215-solved-decimals/#findComment-188931 Share on other sites More sharing options...
Ninjakreborn Posted February 19, 2007 Author Share Posted February 19, 2007 Perfect, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/39215-solved-decimals/#findComment-189007 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.