formattedText property

String get formattedText

Implementation

String get formattedText {
  if (isAmount) {
    final rawValue = itemToString != null
        ? itemToString!(itemContent)
        : itemContent.toString();

    NumberStyle style;
    switch (numberFormatType) {
      case CellNumberFormat.indian:
        style = NumberStyle.indian;
        break;
      case CellNumberFormat.international:
      case CellNumberFormat.none:
        style = NumberStyle.international;
        break;
    }

    return NRBNumberFormatter.format(
      rawValue,
      style: style,
      roundMode: roundMode,
      roundTo: roundTo,
    );
  } else {
    return itemToString != null
        ? itemToString!(itemContent)
        : itemContent.toString();
  }
}