If I have a.toFixed(3); in javascript (\'a\' being equal to 2.4232) what is the exact equivalent command in php to retrieve that? I searched for it but found n
a.toFixed(3);
A direct equivalent is sprintf('%.03F', $a). This will format the value in question as a number with 3 decimal digits. It will also round if required.
sprintf('%.03F', $a)