Skip to main content

ECMA_CEILING

Rounds the number up to the nearest multiple of significance. Negative numbers are rounded towards zero.

Syntax

expression.ECMA_CEILING(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe value to round up.
arg2RequiredApiRange | ApiName | numberThe multiple of significance to round up to.

Returns

number

Example

Round the number up to the nearest multiple of significance. Negative numbers are rounded towards zero in a spreadsheet.

// How to round up the number in a spreadsheet.

// Use function to round up a number to the nearest multiple of significance in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.ECMA_CEILING(1.567, 0.1));