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