I am bringing the sum of the values from the database and as a result it returns me according to the example below:
6.3285714285714
I would like it to look like this:
6.32
I've tried ceil()
and round()
, but both have returned me more or less. I tried to use substr($valor,0,4);
, but the problem is when the value stays:
6.328
Remembering that the value may also return:
16.3285714285714
And I believe that substr()
would not be the solution. How could I solve this?