TRUNCATE

All functions > MATH > TRUNCATE

Truncates a number towards zero (removes the fractional part).

Syntax

TRUNCATE(expr)
sql

Arguments

ParameterTypeRequiredDescription
numberDOUBLEYesThe number to truncate

Returns

BIGINT - Integer result after truncation

Notes

  • Removes the fractional part, rounding towards zero
  • TRUNCATE(2.9) = 2, TRUNCATE(-2.9) = -2
  • Different from FLOOR for negative numbers
  • TRUNCATE(-2.9) = -2 vs FLOOR(-2.9) = -3
  • Returns NULL if the input is NULL
  • Also known as "truncation" or "chopping"

Examples

Last update at: 2025/10/13 10:23:46