currencyShortened static method

String currencyShortened(
  1. double value,
  2. bool includePrefix
)

Convert current value to a shortened version.

Implementation

static String currencyShortened(double value, bool includePrefix) {
  final short = _shortened(value, value);

  if (includePrefix) {
    final prefix = value > 0.0
        ? '+'
        : value < 0.0
            ? '-'
            : '';
    return prefix + short;
  }

  return short;
}