formatInt method

String formatInt({
  1. dynamic nullTxt = "-",
})

Implementation

String formatInt({nullTxt = "-"}) {
  if (this == null) {
    return nullTxt;
  }
  int num;
  try {
    num = int.parse(toString());
  } catch (e) {
    loggerNoStack.d("转换异常:$e");
    return nullTxt;
  }
  return num.toString();
}