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. When no format is specified, trailing zeros are trimmed.
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 decimal numbers with high precision using .NET-compatible format strings.
Similar to DotNetFloatFormatter but with different default precision behavior. When no format is specified, trailing zeros after the decimal point are automatically trimmed.
Example