prorm API Reference
    Preparing search index...

    Function sqlTruncate

    • Truncate a value toward zero (no rounding), optionally to decimals decimal places.

      • mysql / mariadb: TRUNCATE(value, decimals) (function name is TRUNCATE, not TRUNC; decimals defaults to 0 when omitted).
      • oracle / postgres / cockroachdb / redshift / db2 / snowflake: TRUNC(value, decimals).
      • mssql: no TRUNC/TRUNCATE function at all -- uses the (real, if obscure) third argument of T-SQL's ROUND(value, decimals, function), where a non-zero third argument truncates instead of rounding: ROUND(value, decimals, 1).
      • sqlite: the math-functions extension's trunc(X) only accepts a single argument (no decimals support) -- when decimals is supplied, a TRUNC(value * 10^n) / 10^n fallback is used.
      • clickhouse: trunc(value, decimals) (lower-case, 2-arg form supported).

      Parameters

      Returns { $literal: string }