Madatan Posted April 26, 2007 Share Posted April 26, 2007 I have voting script who shows the amount of votes in percent, I do however get number such as 66,666667%. How can I make it show only the 66% and nothing more? Quote Link to comment https://forums.phpfreaks.com/topic/48760-solved-easy-question-rounding-off/ Share on other sites More sharing options...
AndyB Posted April 26, 2007 Share Posted April 26, 2007 floor(), ceil(), round() - all in the manual. Choose the one you really want. Here's round() -> http://ca.php.net/manual/en/function.round.php Quote Link to comment https://forums.phpfreaks.com/topic/48760-solved-easy-question-rounding-off/#findComment-238969 Share on other sites More sharing options...
Madatan Posted April 26, 2007 Author Share Posted April 26, 2007 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/48760-solved-easy-question-rounding-off/#findComment-238999 Share on other sites More sharing options...
taith Posted April 26, 2007 Share Posted April 26, 2007 just as a subnote... when you round()... if you have a MASSIVE number(before decimal place)... it does automatically translate it into scientific notation... Quote Link to comment https://forums.phpfreaks.com/topic/48760-solved-easy-question-rounding-off/#findComment-239000 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.