Function trunc

  • Calculates the truncation of a number

    Parameters

    • num: number

      The number to calculate the truncation for.

    Returns number

    The integer part of the given number.

    Example

    trunc(-4.6);             // Returns -4
    trunc(10.5); // Returns 10

Generated using TypeDoc