PC Nerd Posted August 7, 2007 Share Posted August 7, 2007 Hi, If i have $Money = 200000; Then how can i get it to automatically place "," within that number, to convert it to a string? I can easily add "$" etc. but im stumped on this "," buisness. Thanks Link to comment https://forums.phpfreaks.com/topic/63676-formatting-currencies-from-an-int/ Share on other sites More sharing options...
Daniel0 Posted August 7, 2007 Share Posted August 7, 2007 number_format() Link to comment https://forums.phpfreaks.com/topic/63676-formatting-currencies-from-an-int/#findComment-317341 Share on other sites More sharing options...
sasa Posted August 7, 2007 Share Posted August 7, 2007 try <?php $a = 1000; echo '$ ', number_format($a, 2, '.', ','); ?> Link to comment https://forums.phpfreaks.com/topic/63676-formatting-currencies-from-an-int/#findComment-317342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.