function roundDownToNearest10($num) {
return floor($num / 10) * 10;
}
echo roundDownToNearest10(33) . "\n";
echo roundDownToNearest10(59) . "\n";
echo roundDownToNearest10(599.99) . "\n";
echo roundDownToNearest10(3.14) . "\n";
echo roundDownToNearest10(2) . "\n";
echo roundDownToNearest10(19) . "\n";
echo roundDownToNearest10(-12) . "\n";
echo roundDownToNearest10(-101) . "\n";
echo roundDownToNearest10(-109) . "\n";
/*
run:
30
50
590
0
0
10
-20
-110
-110
*/