DSQL, PSQL

    Syntax

    Result type

    , (scaled) BIGINT or DOUBLE PRECISION

    Returns the integer part of a number. With the optional scale argument, the number can be truncated to powers-of-ten multiples (tens, hundreds, tenths, hundredths, etc.) instead of just integers.

    Notes

    • If the scale argument is present, the result usually has the same scale as the first argument, e.g.

      • returns 789.2200 (not 789.22)

      • TRUNC(-163.41, 0) returns -163.00 (not -163)

      • returns -163

    If you are used to the behaviour of the , please notice that the internal function TRUNC always truncates toward zero, i.e. upward for negative numbers.