TRUNCATE()

Overview

Returns a number truncated to the requested number of decimal places.

USAGE

TRUNCATE(number, count)

Argument Name

Description

number

The numeric to modify

count

The number of digits desired after the decimal point

DETAILS

TRUNCATE() is a mathematical function that returns the number truncated to count decimal places.

A NULL is returned if either argument is NULL or the requested number of digits is not in the range 0-6.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT TRUNCATE(1.555, 0), TRUNCATE(-1.555, 1);
+--------------------+---------------------+
| TRUNCATE(1.555, 0) | TRUNCATE(-1.555, 1) |
+--------------------+---------------------+
|                  1 |                -1.5 |
+--------------------+---------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES