fits method

bool fits(
  1. int precision,
  2. int scale
)

Whether the value already fits a NUMERIC column without rounding.

Implementation

bool fits(int precision, int scale) {
  validateDigits(precision, scale);
  return coefficient == BigInt.zero ||
      this.scale <= scale &&
          coefficient.abs().toString().length - this.scale <=
              precision - scale;
}