roundTo method

double roundTo(
  1. int places
)

Implementation

double roundTo(int places) {
  return (this * pow(10, places)).round() / pow(10, places);
}