roundDouble method

double roundDouble({
  1. int places = 2,
})

Round to the given number of decimal places.

This code copied and modified fromhere.

Implementation

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