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? Quote 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; Quote 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. Quote 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 Quote 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 ??? Quote Link to comment https://forums.phpfreaks.com/topic/87478-solved-rounding-down/#findComment-447487 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.