dp static method

double dp(
  1. double val,
  2. int places
)

Implementation

static double dp(double val, int places) {
  double mod = pow(10.0, places) as double;
  return ((val * mod).round().toDouble() / mod);
}