roundWithDigit method

double roundWithDigit(
  1. int digit
)

Implementation

double roundWithDigit(int digit) {
  if (digit <= 0) {
    return this;
  }
  final digitValue = pow(10, digit);
  return (this * digitValue).roundToDouble() / digitValue;
}