CEILING.MATH (Number, Significance?, Mode?) CEILING.MATH (Number; Significance?; Mode?)

Number

Number Number

The number to be rounded.

Significance

Number Number (optional)

The multiple to which the input number should be rounded. If omitted, it is assumed to be 1.

Mode

Number Number (optional)

0 If the number should be rounded towards zero and 1 if the number should be rounded away from zero. If omitted, it is assumed to be 0.

Returns

Number Number

The rounded number.

Returns a number rounded up to the nearest multiple of another number. CEILING.MATH (22) CEILING.MATH (22) returns 22, but CEILING.MATH (22.1) CEILING.MATH (22,1) returns 23.

If a significance is not specified, it is assumed to be 1, meaning that the returned value is an integer. CEILING.MATH (22.1, 5) CEILING.MATH (22,1; 5) returns 25, because 25 is the nearest multiple of 5 that 22.1 can be rounded up to.

Negative numbers are rounded towards zero by default. That means that CEILING.MATH ( - 22.1, 5) CEILING.MATH ( - 22,1; 5) returns -20, not -25. The third parameter may be used to customize this behavior. CEILING.MATH ( - 22.1, 5, 1) CEILING.MATH ( - 22,1; 5; 1) returns -25, not -20.

Examples

CEILING.MATH (22)
CEILING.MATH (22)

Returns 22, assuming a significance of 1.

CEILING.MATH (22.1)
CEILING.MATH (22,1)

Returns 23, assuming a significance of 1.

CEILING.MATH (22.1, 1)
CEILING.MATH (22,1; 1)

Returns 23, with the significance given as the second parameter.

CEILING.MATH (22.1, 5)
CEILING.MATH (22,1; 5)

Returns 25, with the significance given as the second parameter.

CEILING.MATH ( - 22.1, 5)
CEILING.MATH ( - 22,1; 5)

Returns -20, because negative numbers are rounded toward zero by default.

CEILING.MATH ( - 22.1, 5, 1)
CEILING.MATH ( - 22,1; 5; 1)

Returns -25, because the third parameter is set to a value that causes negative numbers to be rounded away from zero.

CEILING.MATH ({ 22, 22.1 })
CEILING.MATH ({ 22; 22,1 })

Returns the array { 22, 23 }{ 22; 23 }.

CEILING.MATH ({ 22, 22.1 }, 1)
CEILING.MATH ({ 22; 22,1 }; 1)

Returns the array { 22, 23 }{ 22; 23 }.

CEILING.MATH ({ 22, 22.1 }, 5)
CEILING.MATH ({ 22; 22,1 }; 5)

Returns the array { 25, 25 }{ 25; 25 }.

CEILING.MATH ({ 22, 22.1 }, { 5, 1 })
CEILING.MATH ({ 22; 22,1 }; { 5; 1 })

Returns the array { 25, 23 }{ 25; 23 }. 22 uses a significance of 5 and 22.1 uses a significance of 1.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell