Moron Posted February 5, 2008 Share Posted February 5, 2008 Okay, let's say that my database result produces the number.... 423487.00 I can easily use substr() to give me "423," a comma, then "487.00" to produce... 423,487.00 But.... if the thousands position is under 100, like say 23,487.00, then it adds a number from somewhere. How do I directly plug the comma in there, putting it 6 positions from the right, regardless of what is before it? Quote Link to comment https://forums.phpfreaks.com/topic/89559-solved-add-comma-to-a-number-using-substr/ Share on other sites More sharing options...
trq Posted February 5, 2008 Share Posted February 5, 2008 number_format(). Quote Link to comment https://forums.phpfreaks.com/topic/89559-solved-add-comma-to-a-number-using-substr/#findComment-458780 Share on other sites More sharing options...
Moron Posted February 5, 2008 Author Share Posted February 5, 2008 number_format(). That's it. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/89559-solved-add-comma-to-a-number-using-substr/#findComment-458790 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.