round

Rounds a number

round(x);

will return the number x rounded to nearest integer. There's no custom return_type, as the function always returns an integer. Example:

round(5.3); //5
round(-2.4); //-2
round(0.6); //1

Last updated