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? 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 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! 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... 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
Archived
This topic is now archived and is closed to further replies.