Documentation

    abs

    Return the absolute value of a number, removing any minus sign.

    Try an expression

    In Formula, enter the expression and set Output type to DOUBLE.

    Expression

    abs(-17.4)

    Result

    17.4

    The expression returns DECIMAL(3,1). Formula stores it as DOUBLE in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    abs(x)
    x
    Number
    Supported signatures (13)
    abs(x: BIGINT) → BIGINT
    abs(x: DECIMAL) → DECIMAL
    abs(x: DOUBLE) → DOUBLE
    abs(x: FLOAT) → FLOAT
    abs(x: HUGEINT) → HUGEINT
    abs(x: INTEGER) → INTEGER
    abs(x: SMALLINT) → SMALLINT
    abs(x: TINYINT) → TINYINT
    abs(x: UBIGINT) → UBIGINT
    abs(x: UHUGEINT) → UHUGEINT
    abs(x: UINTEGER) → UINTEGER
    abs(x: USMALLINT) → USMALLINT
    abs(x: UTINYINT) → UTINYINT

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    If the first argument is missing, the result is NULL.

    Browse numbersDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.