toPercentage method

String toPercentage({
  1. int fractionDigits = 2,
  2. String suffix = '%',
})

Converts to a percentage string (multiplying by 100).

  • fractionDigits is the number of fraction digits.
  • suffix the percentage suffix. Default: %

Implementation

String toPercentage({int fractionDigits = 2, String suffix = '%'}) =>
    (this * 100).toStringAsFixed(fractionDigits) + suffix;