Jump to content

number formatting...


seany123

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.