10
I am bringing from the database the sum of the values and as a result it returns me as the example below:
6.3285714285714
I wish he’d stay that way:
6.32
I’ve tried the ceil()
and the round()
, but both returned me for more or less. I tried to use the substr($valor,0,4);
, but the problem is when the value is:
6.328
Remembering that the value can also return:
16.3285714285714
And I believe that the substr()
would not be the solution. How could I solve this?
try this way substar($value+0,4);
– Willian Lima
Thanks Willian, but Maniero’s solution was the one that best adapted.
– user24136
Excellent, learning for me too! haha
– Willian Lima