dectrunc()

Truncates a decimal value according to a number of decimal digits.

Syntax

void dectrunc(dec_t *np, mint trunc);
  1. np is a pointer to the decimal structure for a rounded number to truncate.
  2. trunc is the number of fractional digits. Use a positive number or zero for this argument.

Usage

To truncate a decimal value, specifying the number of digits to the right of the decimal point.