I have a little code that does a certain calculation and as you know if decimals are printed PHP
many come out, what I want is to limit this number to 5 decimals.
Try to use round
and although with this you can specify a maximum number of decimal places it also rounds them and no, I only want a number of decimal places without rounding the result.
For example:
The result throws:
4.6472883
And what I need is:
4.64728 (5 decimales)
What it round
does is:
4.64729
This is the small part that does the calculation in case it is useful to you
//$l_value: es un valor que ingresa el usuario
//$l_mam y $l_ang: son valores ya definido
$to_m = $l_value*$l_mam;
$l_r = $to_m/$l_ang;
echo"<div class='in_val_res' > ".round($l_r,5)." unidades</div>";