papaface Posted October 9, 2007 Share Posted October 9, 2007 Hello, I have a string: "1034" How can I dynamically add the relevant commas so it would show up "1,034", and if it changes to "7854355" make it show "7,854,355"? Thanks Link to comment https://forums.phpfreaks.com/topic/72387-solved-add-commas-to-numbers-1034-1034/ Share on other sites More sharing options...
pocobueno1388 Posted October 9, 2007 Share Posted October 9, 2007 <?php $num = "16546981"; echo number_format($num); ?> Link to comment https://forums.phpfreaks.com/topic/72387-solved-add-commas-to-numbers-1034-1034/#findComment-365070 Share on other sites More sharing options...
papaface Posted October 9, 2007 Author Share Posted October 9, 2007 Ah ha Thanks Link to comment https://forums.phpfreaks.com/topic/72387-solved-add-commas-to-numbers-1034-1034/#findComment-365071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.