I want to round a value in my php project in such a way that instead of showing me for example 12.5 it shows me the zero of 50 (12.50)
I want to round a value in my php project in such a way that instead of showing me for example 12.5 it shows me the zero of 50 (12.50)
In Twig (which, from what I see is the template system you are using), you also have a call to number_format that works in a very similar way:
{{ tu_numero | number_format(2, ',', '.') }}
The parameters are the following:
you can do it like that
javascript:
var num=12.5;
num.toFixed(2);
php:
$num=12.5;
money_format('%i', $number);
In php you can use string number_format ( float $number , int $decimals = 0 , string $dec_point = ".")