PHP - Number: Rounding a Floating Point NumberTag: number, round, float Category: PHP Basicpost: 16 Mar 2008 read: 203 PHP Number Tips - Part 15: If you want to round off a floating-point number, you can use the round( ) function such as:
The round( ) function rounds a number to a specified number of decimal places.Calling round( ) without the optional second argument will make it round into an integer value (0 decimal places). When rounding into an integer, the round( ) function will return the closest integer value. In order to force rounding to a lower or higher integer value, you can use the ceil( ) or floor( ) functions as following:
|
| | Give Your Opinion | Recommend |
|

