roundDouble method

double roundDouble(
  1. int precision
)

Rounding number to decimal places

Implementation

double roundDouble(int precision) {
  num mod = pow(10.0, precision);
  return ((this * mod).round().toDouble() / mod);
}