In this PostgreSQL post explains how to use the PostgreSQL trunc function with syntax and examples.
The PostgreSQL trunc function returns a number truncated to a certain number of decimal places.
The syntax for the trunc function in PostgreSQL is:
The number to truncate.
Optional. The number of decimal places to truncate to. This value must be a positive or negative integer.
The trunc function can be used in the following versions of PostgreSQL:
Let's look at some PostgreSQL trunc function examples and explore how to use the trunc function in PostgreSQL.
For example: