function roundUpToNearest10($num) {
return ceil($num / 10) * 10;
}
echo roundUpToNearest10(33) . "\n";
echo roundUpToNearest10(59) . "\n";
echo roundUpToNearest10(599.99) . "\n";
echo roundUpToNearest10(3.14) . "\n";
echo roundUpToNearest10(2) . "\n";
echo roundUpToNearest10(19) . "\n";
echo roundUpToNearest10(-12) . "\n";
echo roundUpToNearest10(-101) . "\n";
echo roundUpToNearest10(-109) . "\n";
/*
run:
40
60
600
10
10
20
-10
-100
-100
*/