Jump to: navigation, search

PostgreSQL TRUNC

From w3cyberlearnings

Contents

Postgresql trunc

Returns a trucate input number toward zero.

Syntax trunc

  • x is an integer
  • v is an integer,
  • s is decimal places to truncate.
trunc(X);

or

trunc(v numberic, s int);

Example 1

postgres=# SELECT TRUNC(54.2);
 trunc 
-------
    54
(1 row)

Example 2


postgres=# SELECT TRUNC(23.53423,3);
 trunc  
--------
 23.534
(1 row)

Related Links



Navigation
Web
SQL
MISC
References