roundDouble method
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;
}