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

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -