constrain method
Apply the constraints used in the current formatter to the given number. Applies maxFractionDigits, significantDigits, and the rounding mode, and returns the constrained number.
Implementation
double constrain(num number) {
return _constrain(number.toDouble());
}