toPercentage function

String toPercentage(
  1. double value,
  2. int fractionDigits
)

Returns a formatted percentage string from a double value.

Implementation

String toPercentage(double value, int fractionDigits) {
  return '${(value * 100).toStringAsFixed(fractionDigits)} %';
}