Math.Ceiling(Value)

.Ceiling() method rounds the value up to the next highest integer.

Applies To

Math

Description

Math.Ceiling() method rounds the value up to the next highest integer that is greater than or equal to the value supplied.

The Functions and Operators equivalent is CEILING(nExpression).

Properties and Methods

None

Available

The .Ceiling(Value) method is available in:

  • 15.03.016
  • All newer builds

Type

Decimal

Syntax

Math.Ceiling(Value);

Parameters

Parameter

Required

Description

Value

Yes

Any number.

Any value that is not a number will result in a scripting error.

Example

var lnJobQty = 1100; //--taken from the lj_quant field

var lnPalletQty = 45; //--taken from an item master UDF

Event.Form.MessageBox('The number of pallets needed is: ' + Math.Ceiling(lnJobQty / lnPalletQty));

 

/* Expected System Prompt Display:

The number of pallets needed is: 25

*/