-1

Hi i have a one question.

I get this numbers in result: 1.1115628363

I want to show the first three numbers example: 1.11

But i dont know how to do this. Thank you for your help

2 Answers2

1
$number = 1.1115628363;
$formated_number = number_format($number, 2, '.', '');
Naga
  • 2,190
  • 3
  • 16
  • 21
0

You can use substr function for that.

Try below code :

$test = 1.1115628363;
echo substr($test, 0, 4);
Manthan Dave
  • 2,137
  • 2
  • 17
  • 31