round static method

double round(
  1. num value, [
  2. int precision = 0
])

Rounds value to precision decimal places.

Implementation

static double round(num value, [int precision = 0]) {
  final f = math.pow(10, precision);
  return (value * f).round() / f;
}