getFormattedNumber function

String getFormattedNumber(
  1. String? value
)

Implementation

String getFormattedNumber(String? value) {
  return double.tryParse("${value ?? ""}") == null
      ? "${value ?? ""}"
      : NumberFormat.decimalPattern().format(double.tryParse("${value ?? ""}"));
}