-1
I would like to truncate a value into two decimal places in php, without rounding the value. Ex: 25,98/4 = 6,495. But in PHP it appears 6.5 I’m using the number_format:
$valor_pedido = number_format($pedidoArray['valor_produto'] / ($totalComandasDiv + 1),2, '.', '');
How do I get the value 6,49 ?
The result was 6.48.. However the division gives 6.495, it rounded down, as keep only the 6.49 without arrendondar the value?
– Miguel Botelho
What are the values of your variables in the case you gave 6.48? Look at an example working https://ideone.com/YSDlKR
– Mauro Roberto