-1

For example I have a number 6.074 is it possible "round" it to number 6.08 ?

Justas
  • 101
  • 2
  • 8

2 Answers2

2

Try this:

$a = 6.074;
$a = ceil($a*100)/100;
echo $a;

Output:

6.08
n-dru
  • 9,285
  • 2
  • 29
  • 42
1

You should do round

<?php 
echo round(6.074,2);
?>

Note :

6.074 is always 6.07

Only 6.076 is 6.08

Community
  • 1
  • 1
Sulthan Allaudeen
  • 11,330
  • 12
  • 48
  • 63