roundToIfCloseTo method

double roundToIfCloseTo(
  1. double other, {
  2. double epsilon = _defaultEpsilon,
})

If the double is within epsilon of other, returns other, otherwise returns this double.

Implementation

double roundToIfCloseTo(double other, {double epsilon = _defaultEpsilon}) =>
    isCloseTo(other, epsilon: epsilon) ? other : this;