roundWithPrecision method

double roundWithPrecision(
  1. int N
)

Implementation

double roundWithPrecision(int N) {
  return (this * pow(10.0, N)).round() / pow(10.0, N);
}