formatDecimalPattern method
Formats a dynamic value using a custom decimal pattern.
Uses the "en" locale for formatting.
Implementation
String formatDecimalPattern(dynamic value, String pattern) {
if (value is int) value = value.toDouble();
final formatter = NumberFormat(pattern, "en");
String newText = formatter.format(value);
return newText;
}