toNumFormatted method

num toNumFormatted(
  1. String format,
  2. String? locale
)

Parses this string using a NumberFormat pattern.

The format pattern follows NumberFormat conventions (e.g., '#,##0.00'). Uses locale for localized grouping and decimal separators.

Throws if the string does not match the expected format.

Implementation

num toNumFormatted(String format, String? locale) {
  final f = _getNumberFormat(format, locale);
  final parsed = f.parse(this);
  return parsed;
}