Truncate

Function

Truncate(value)

value

Truncate(value, digits)

value
digits

Use

The Truncate() function returns the next lower integer, rounding down towards zero. The function "truncates" the numbers after the decimal.

Units

Numbers with units will be rounded based on those units. This means that the unit a number has at the point of calculation will affect the answer.

For example, Truncate(5.8ft) to mm and Truncate(5.8 ft to mm) will return values that are not equal.

Examples
  • Truncate(1.8)  = 1
  • Truncate(1.2)  = 1
  • Truncate(-1.8)  = -1
  • Truncate(3.2 ft)  = 3ft
  • Truncate(3.2 ft) to mm  = 914.4 mm
  • Truncate(3.2 ft to mm)  = 975 mm

Truncate is included by default in each file as part of the Math library.

 

See also: