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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/148688-number-formatting/#findComment-780774 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.