Formats the number using a custom pattern with the given locale.
pattern
locale
String formatWithCustomPattern(String pattern, {String? locale}) { return NumberFormat(pattern, locale).format(this); }