Math.trunc

Math.trunc

Math.trunc

Function

Truncate decimals. Returns the number minus the decimal part.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
valueNumberYesNoneThe number to participate in truncation.

Return value

TypeDescription
Int/FloatReturns the number minus the decimal part. An Int is returned for integer results, and a Float for non-integer or non-finite results.

Example

Notes

  • Only decimals are truncated, no rounding is done.