Here is my code:
protected function roudUp(float $amount) : float {
$fraction = self::ROUNDING_PRECISION > 0 ? self::ROUNDING_PRECISION : 0;
$mult = pow(10, $fraction);
$roundedUp = ceil($amount * $mult) / $mult;
return number_format($roundedUp, 2);
}
It works properly and returns always two decimal places like 1.60. But it converts to 1.6 in the console. See:

The expected result is:
1.00
0.46
1.60
2.40
48.62
How can I avoid that?
>Solution :
number_format() returns a string. The function must also return a string and not a float!
function roudUp(float $amount) : string {
$fraction = 2;
$mult = pow(10, $fraction);
$roundedUp = ceil($amount * $mult) / $mult;
return number_format($roundedUp, 2);
}
echo roudUp(1.6); //1.60