sk121506 Posted January 24, 2008 Share Posted January 24, 2008 is there a way to round down the nearest tenth such as... 138 becomes 130 i know round(134, -1) would give me 130, but anything like 139 rounded to 130? Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/ Share on other sites More sharing options...
teng84 Posted January 24, 2008 Share Posted January 24, 2008 numer divided by ten $teng = (int)(189/10); echo $teng *10; Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/#findComment-447435 Share on other sites More sharing options...
sk121506 Posted January 24, 2008 Author Share Posted January 24, 2008 easy enough, guess the math was just confusing me. Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/#findComment-447444 Share on other sites More sharing options...
Nhoj Posted January 24, 2008 Share Posted January 24, 2008 Could also use floor() http://us.php.net/manual/en/function.floor.php Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/#findComment-447479 Share on other sites More sharing options...
teng84 Posted January 24, 2008 Share Posted January 24, 2008 is there a way to round down the nearest tenth such as... 138 becomes 130 i know round(134, -1) would give me 130, but anything like 139 rounded to 130? Could also use floor() http://us.php.net/manual/en/function.floor.php I dont know how you can use floor on this ??? Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/#findComment-447487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.