Math.Truncate(Value)

.Truncate() method returns the integer portion of the Value provided.

Applies To

Description

Math.Truncate() method returns the integer portion of the Value provided.

Properties and Methods

None

Available

The .Truncate(Value) method is available in:

  • 15.03.016
  • All newer builds

Type

Decimal

Syntax

Math.Truncate(Value);

Parameters

Parameter

Required

Description

Value

Yes

Any data that can be evaluated as a number.

If the value cannot be evaluated as a number, then DEACOM will throw a scripting error.

Example

Event.Form.MessageBox('Math.Truncate(1.987): ' + Math.Truncate(1.987) +

'\nMath.Truncate(-.2.356): ' + Math.Truncate(-2.356) +

'\nMath.Truncate(0.123): ' + Math.Truncate(0.123) +

'\nMath.Truncate(-0.123): ' + Math.Truncate(-0.123));

 

/* Expected System Prompt Display:

Math.Truncate(1.987): 1

Math.Truncate(-.2.356): -2

Math.Truncate(0.123): 0

Math.Truncate(-0.123): 0

*/