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? 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(). 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! 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
Archived
This topic is now archived and is closed to further replies.