fgl_decimal_truncate()

Returns a decimal truncated to the precision passed as parameter.

Syntax

fgl_decimal_truncate(
   value DECIMAL,
   decimals INTEGER )
  RETURNING result DECIMAL
  1. value is the decimal to be converted.
  2. decimals defines the number of digits after the decimal point.

Usage

This function truncates the decimal to the number of decimal digits specified.

The value is not rounded, it is just truncated. For example, when truncating 12.345 to 2 decimal digits, the result will be 12.34, not 12.35.