Jump to content

Number format and rounding


jasper1106

Recommended Posts

Hi fellas,

 

Can anyone show me why my script is still rounding up / down?

 

printf ("<tr> %s Avg gun Ahit %%</td> %s %.2f %%</td></tr>\n",$tdo,$tdor,number_format($ahit/$fired*100, 3, '.', ''));

 

Do I have a syntax error as I cannot get my math equation to display more than 2 decimal places even though it's set to 3?

 

Any help or advice would be really great.

Link to comment
https://forums.phpfreaks.com/topic/209533-number-format-and-rounding/
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.