formatPercent function

String formatPercent(
  1. double? value
)

Formats a double value to a percentage string using the kPercentFormatter. Returns 'n/a' if the value is null.

Implementation

String formatPercent(double? value) {
  if (value == null) return formatNullable(value);
  return kPercentFormatter.format(value);
}