How to use round in PHP
This article describe about round() Function in PHP.
round() Function
This function round to the floating point number into the nearest integer number.
Syntax
Parameter |
Description |
x |
Specified number to be round |
prec |
Specified the number of digit after floating point. |
Example
<html>
<body>
<?php
echo(round(1.40) . "<br />");
echo(round(0.50) . "<br />");
echo(round(0.40) . "<br />");
echo(round(-5.20) . "<br />");
echo(round(-4.80))
?>
</body>
</html> |
Output

You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here