jasper1106 Posted August 1, 2010 Share Posted August 1, 2010 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 More sharing options...
ChemicalBliss Posted August 1, 2010 Share Posted August 1, 2010 %.2f should be 3, or just %s -cb- Link to comment https://forums.phpfreaks.com/topic/209533-number-format-and-rounding/#findComment-1093944 Share on other sites More sharing options...
Daniel0 Posted August 1, 2010 Share Posted August 1, 2010 Why are you using number_format() and printf() at the same time? Link to comment https://forums.phpfreaks.com/topic/209533-number-format-and-rounding/#findComment-1093945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.