Mateobus Posted September 11, 2006 Share Posted September 11, 2006 I want to make a number have 3 decimal places regardless of what it is. Ie$i = 7;i want 7.00 Quote Link to comment Share on other sites More sharing options...
jefkin Posted September 11, 2006 Share Posted September 11, 2006 Um, what about 37 do you want 37.00 or 37.0 ???Do you mean signifigant figures?How about .00002323 do you want .000 or do you want .0000232round()provides some functionality you might find useful.Jeff Quote Link to comment Share on other sites More sharing options...
Jenk Posted September 11, 2006 Share Posted September 11, 2006 [url=http://us2.php.net/manual/en/function.number-format.php]number_format()[/url] may also be of use. Quote Link to comment Share on other sites More sharing options...
°°Ben³ Posted September 11, 2006 Share Posted September 11, 2006 sprintf(), too. Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 11, 2006 Share Posted September 11, 2006 [quote author=Jenk link=topic=107590.msg431974#msg431974 date=1157964286][url=http://us2.php.net/manual/en/function.number-format.php]number_format()[/url] may also be of use.[/quote]that's probably your best bet since it returns a float with the exact precision you request. Quote Link to comment 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.