ProtectedformatThe locale settings that determine decimal/thousands separators and other culture-specific formatting.
Contains the error message from the last failed operation. Check this property if DotNetNumberFormatter.trySetFormat or parsing methods return an error.
The (DotNetNumberStyles:var) that control which number formats are allowed during parsing.
ProtectedformatProtectedsetFormats a number using the current format string.
The number to format.
The formatted number string.
ProtectedtrimAttempts to parse a number from a string using the current parsing styles.
The string to parse.
A Result containing the parsed number if successful, or an error if parsing fails.
Sets the format string to use for formatting numbers.
The format string is tokenized to confirm validity and to optimize formatting/parsing operations.
A standard format string (e.g., "C", "N2", "E3") or custom format string (e.g., "#,##0.00").
A Result indicating success or containing an error message if the format string is invalid.
ProtectedunstyleStatictry
Formatter for floating-point numbers using .NET-compatible format strings.
Supports all standard numeric format strings (C, D, E, F, G, N, P, R, X, B) and custom format strings with digit placeholders, separators, and sections.
Example