formatDecimal method

String formatDecimal(
  1. dynamic value
)

Implementation

String formatDecimal(dynamic value) {
  if (value is int) value = value.toDouble();

  double valor = value == 0 ? 0.0 : value;

  final formatter = new NumberFormat("0.00", "en");
  String newText = formatter.format(valor);
  return newText;
}