roundDouble function

double roundDouble(
  1. double value,
  2. int places
)

Implementation

double roundDouble(double value, int places) {
  assert(places > 0, 'Parameter places has to be larger than 0');
  double mod = pow(10.0, places) as double;
  return ((value * mod).round().toDouble() / mod);
}