floor static method

double floor(
  1. double value, {
  2. int precision = 2,
})

Rounds toward negative infinity.

1.9 → 1, -1.1 → -2

Implementation

static double floor(double value, {int precision = 2}) {
  final factor = math.pow(10, precision);
  return (value * factor).floorToDouble() / factor;
}