formatPercent static method

String formatPercent(
  1. double? value, [
  2. int significantFigures = 2
])

Implementation

static String formatPercent(double? value, [int significantFigures = 2])
{
  if (value == null || value.isInfinite || value.isNaN) {
    return "(no data)";
  }
  else {
    return Arithmetic.toSignificantFigures(value * 100, significantFigures).toString() + "%";
  }
}