Complete PHP Math Reference
The round() function rounds a number to the nearest integer.
| Parameter | Description |
|---|---|
| x | Required. The number to be round |
| prec | Optional. The number of digits after the decimal point |
In this example we will round different numbers with the round() function:
The output of the code above will be:
Complete PHP Math Reference
Your message has been sent to W3Schools.