floating point - How can I make sure a float will always be rounded up with PHP? -


i want make sure float in php rounded if any decimal present, without worrying mathematical rounding rules. function work follows:

1.1 2 1.2 2 1.9 2 2.3 3 2.8 3 

i know round() function exists don't see function rounding if decimal found. there easy way this?

use ceil function:

$number = ceil(1.1); //2 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -