echo round(520.34345, 2); // 520.34
echo round(520.3, 2); // 520.3
echo round(520, 2); // 520
<?php
$number1 = 5;
$number2 = 34.600;
$number3 = 15439.093;
$format_number1 = number_format($number1, 2);
$format_number2 = number_format($number2, 2);
$format_number3 = number_format($number3, 2, "d", "@");
echo "The number $number1 after formating is: $format_number1
";
echo "The number $number2 after formating is: $format_number2
";
echo "The number $number3 after formating is: $format_number3
";
//Output
The number 5 after formating is: 5.00
The number 34.6 after formating is: 34.60
The number 15439.093 after formating is: 15@439d09
?>
echo round(5366.8122270742, 2); //5366.81