roundDecimal method

double roundDecimal({
  1. int? places,
})

Rounds value to the decimal places

Implementation

double roundDecimal({int? places}) {
  if (isNaN || isInfinite) {
    return this;
  }

  final factor = places != null ? pow(10, places) : roundFactor;

  return (this * factor).round() / factor;
}