roundTo method

double roundTo([
  1. int? precision
])

Implementation

double roundTo([int? precision]) {
  var mod = math.pow(10.0, precision!);
  return ((this * mod).round().toDouble() / mod);
}