scale property

int get scale

The scale of this num.

The number of digits after the decimal point.

WARNING for dart2js : It can give bad result for large number.

Throws StateError if the scale is infinite, i.e. when hasFinitePrecision is false.

Implementation

int get scale {
  if (!hasFinitePrecision) {
    throw StateError('This number has an infinite precision: $this');
  }
  var i = 0;
  var x = numerator;
  while (x % denominator != _i0) {
    i++;
    x *= _i10;
  }
  return i;
}