decround()

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

Syntax

void decround(dec_t *np, mint dec_round);
  1. np is a pointer to a decimal structure whose value is to be rounded. Use a positive number for the np argument.
  2. dec_round is the number of fractional digits to which the value is rounded.

Usage

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