*
* 1998 Jan Wieck
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.23 2000/01/18 03:44:41 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.24 2000/01/20 02:21:44 tgl Exp $
*
* ----------
*/
set_var_from_var(var, &tmp);
tmp.rscale = 0;
- tmp.ndigits = MAX(0, tmp.weight + 1);
+ tmp.ndigits = MIN(tmp.ndigits, MAX(0, tmp.weight + 1));
if (tmp.sign == NUMERIC_POS && cmp_var(var, &tmp) != 0)
add_var(&tmp, &const_one, &tmp);
set_var_from_var(var, &tmp);
tmp.rscale = 0;
- tmp.ndigits = MAX(0, tmp.weight + 1);
+ tmp.ndigits = MIN(tmp.ndigits, MAX(0, tmp.weight + 1));
if (tmp.sign == NUMERIC_NEG && cmp_var(var, &tmp) != 0)
sub_var(&tmp, &const_one, &tmp);