tommy445 Posted March 9, 2009 Share Posted March 9, 2009 hello, this string works great for placing decimals but how to get commas into this string? <?php print ("%01.2f, $client_primary_job) ?> Quote Link to comment https://forums.phpfreaks.com/topic/148556-solved-formatting-commas/ Share on other sites More sharing options...
Philip Posted March 9, 2009 Share Posted March 9, 2009 number_format() Quote Link to comment https://forums.phpfreaks.com/topic/148556-solved-formatting-commas/#findComment-780091 Share on other sites More sharing options...
Maq Posted March 9, 2009 Share Posted March 9, 2009 Try: $number = 1000; echo number_format($number, 2); ?> Quote Link to comment https://forums.phpfreaks.com/topic/148556-solved-formatting-commas/#findComment-780096 Share on other sites More sharing options...
tommy445 Posted March 9, 2009 Author Share Posted March 9, 2009 thanks a mil, I just had to learn how to apply it. Quote Link to comment https://forums.phpfreaks.com/topic/148556-solved-formatting-commas/#findComment-780405 Share on other sites More sharing options...
Maq Posted March 9, 2009 Share Posted March 9, 2009 thanks a mil, I just had to learn how to apply it. Just replace $number with $client_primary_job... Quote Link to comment https://forums.phpfreaks.com/topic/148556-solved-formatting-commas/#findComment-780419 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.