Home >Backend Development >PHP Tutorial >PHP float function rounding example code
No rounding, only integers
floor function 2.1 = 2
2.6 = 2
Do not round floating point into 1
ceil function: 2.1 = 3
2.6 = 3
ceil(-3.14)=-3
ceil(9.99)=10
Rounding function: 2.1 = 2
2.6 = 3
round(1.9558 3, 2) =1.96
intval function 2.1 = 2
2.6 = 2
intval('abc')=0
intval('5bc')=5
The above is the detailed content of PHP float function rounding example code. For more information, please follow other related articles on the PHP Chinese website!