
Kwame O. answered 06/05/19
Tutor
5
(8)
Experienced PHP Developer
Use php function:
round ( float $val
[, int $precision
= 0 [, int $mode
= PHP_ROUND_HALF_UP ]] ) : float
Example:
if is_float($number)) then
round($number, 2)
otherwise just add ".00" to the string $number.".00"