deccvdbl()

Converts a double value to a decimal value.

Syntax

mint deccvdbl(double dbl, dec_t *np);
  1. dbl is the double value to convert to a decimal type value.
  2. np is a pointer to a decimal structure containing the result of the conversion.

Returns

Table 1. Return codes
Code Description
0 The conversion was successful.
<0 The conversion failed.