NumParsingTextX extension
Extension methods for parsing numeric strings with lenient formatting.
These methods strip common grouping characters (commas, spaces, underscores,
non-breaking spaces) before parsing. Accounting-style negatives like (123)
are converted to -123.
Used internally by Convert.toInt, Convert.toDouble, etc.
- on
Methods
-
toDouble(
) → double -
Available on String, provided by the NumParsingTextX extension
Parses this string as a double. -
toDoubleFormatted(
String format, String? locale) → double -
Available on String, provided by the NumParsingTextX extension
Parses a formatted double using NumberFormat. -
toInt(
) → int -
Available on String, provided by the NumParsingTextX extension
Parses this string as an integer, truncating any fractional component. -
toIntFormatted(
String format, String? locale) → int -
Available on String, provided by the NumParsingTextX extension
Parses a formatted integer using NumberFormat. -
toNum(
) → num -
Available on String, provided by the NumParsingTextX extension
Parses this string into a num after stripping grouping characters. -
toNumFormatted(
String format, String? locale) → num -
Available on String, provided by the NumParsingTextX extension
Parses this string using a NumberFormat pattern. -
tryToDouble(
) → double? -
Available on String, provided by the NumParsingTextX extension
Attempts toDouble, returningnullon failure. -
tryToDoubleFormatted(
String format, String? locale) → double? -
Available on String, provided by the NumParsingTextX extension
Attempts toDoubleFormatted, returningnullon failure. -
tryToInt(
) → int? -
Available on String, provided by the NumParsingTextX extension
Attempts toInt, returningnullon failure. -
tryToIntFormatted(
String format, String? locale) → int? -
Available on String, provided by the NumParsingTextX extension
Attempts toIntFormatted, returningnullon failure. -
tryToNum(
) → num? -
Available on String, provided by the NumParsingTextX extension
Attempts toNum, returningnullwhen parsing fails. -
tryToNumFormatted(
String format, String? locale) → num? -
Available on String, provided by the NumParsingTextX extension
Attempts toNumFormatted, returningnullon failure.