round method Null safety

  1. @override
Value round(
  1. Value v
)
override

Implementation

@override
Value round(Value v) {
  if (v.exponent >= 9) {
    return v;
  }
  final s = formatFixed(v, fractionDigits);
  if (s == null) {
    return Value.zero;
  }
  return Value.fromDouble(double.parse(s.trim()));
}