toFormatInteger static method

dynamic toFormatInteger(
  1. String? valor
)

Implementation

static toFormatInteger(String? valor) {
  valor = valor!.replaceAll(",", ".");
  try {
    valor = NumberFormat("#,##0", "pt_BR").format(double.parse(valor));
  } catch (e) {
    valor = '0';
  }
  if (valor == 'NaN') return '0';
  return valor;
}