seany123 Posted March 10, 2009 Share Posted March 10, 2009 ive got a code which echo's random numbers anywhere between 10 and 60,0000 currently im getting like 58823.529411765 but i want it to echo to 2 decimals places... the code is echo "$statgain"; so how do I number format?? edit: but i also want it to decimalise in the thousands.... example: old 58823.529411765 new 58,823.53 Link to comment https://forums.phpfreaks.com/topic/148688-number-formatting/ Share on other sites More sharing options...
premiso Posted March 10, 2009 Share Posted March 10, 2009 echo number_format($statgain, 2, ".", ","); number_format Link to comment https://forums.phpfreaks.com/topic/148688-number-formatting/#findComment-780774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.