roundNumber static method

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

Implementation

static double roundNumber(double value, int places) {
  num val = pow(10.0, places);
  return ((value * val).round().toDouble() / val);
}