round method

double round({
  1. int digit = 1,
})

Implementation

double round({int digit = 1}) {
  if (isNaN) {
    return 0;
  }

  num mod = pow(10.0, digit);

  return ((this * mod).round().toDouble() / mod);
}