round static method
Standard rounding (rounds halves away from zero).
1.5 → 2, 2.5 → 3, -1.5 → -2
Implementation
static double round(double value, {int precision = 2}) {
final factor = math.pow(10, precision);
return (value * factor).roundToDouble() / factor;
}