toFixed method

double toFixed(
  1. int fractionDigits
)

Formats a double to a fixed number of decimal places.

Implementation

double toFixed(int fractionDigits) {
  return double.parse(toStringAsFixed(fractionDigits));
}