Creates a new DotNetLocaleSettings instance.
OptionallocaleName: string
Optional locale name (e.g., "en-US", "fr-FR"). If undefined, uses the system's current locale.
ReadonlycurrencyCurrency symbol for this locale (e.g., "$", "€", "£").
ReadonlydateCharacter used between date components (e.g., "/", "-", ".").
ReadonlydecimalCharacter used for decimal point (e.g., "." or ",").
ReadonlydefaultPre-configured number formatter for currency values.
ReadonlydefaultPre-configured number formatter for high-precision decimal values.
ReadonlydefaultPre-configured number formatter for floating-point values.
ReadonlyidThe locale identifier (same as name).
ReadonlynameThe locale name (e.g., "en-US", "fr-FR").
ReadonlythousandCharacter used for thousands grouping (e.g., "," or "." or " ").
ReadonlytimeCharacter used between time components (typically ":").
Static ReadonlycurrentSingleton instance for current system locale. Uses the locale settings from the runtime environment.
Static ReadonlyinvariantSingleton instance for invariant culture (en-US). Provides consistent formatting across all systems.
Converts a Date to a string using locale-specific formatting.
The Date to format.
Optionaloptions: DateTimeFormatOptions
Optional Intl.DateTimeFormatOptions for custom formatting.
The formatted date string.
Converts a number or bigint to a string using locale-specific formatting.
The number or bigint to format.
Optionaloptions: NumberFormatOptions
Optional Intl.NumberFormatOptions for custom formatting.
The formatted number string.
Convert a single character to lowercase using culture-specific rules. Handles special cases like Turkish 'I' → 'ı' vs Turkish 'İ' → 'i'.
The character to convert to lowercase.
The lowercased character.
Convert a single character to uppercase using culture-specific rules. Handles special cases like Turkish 'i' → 'İ' vs standard 'i' → 'I'.
The character to convert to uppercase.
The uppercased character.
Attempts to parse a BigInt from a string.
The string to parse. Must contain only digits and an optional leading +/- sign.
A Result containing the parsed BigInt if successful, or an error if parsing fails.
Attempts to parse a boolean value from a string.
The string to parse. Accepts: "true", "1", "yes" (case-insensitive) for true, and "false", "0", "no" for false.
A Result containing the boolean value if successful, or an error if parsing fails.
Attempts to parse a Date from a string.
The string to parse. Accepts various date formats understood by JavaScript Date constructor.
A Result containing the parsed Date if successful, or an error if parsing fails.
Attempts to parse an integer from a string.
The string to parse. Must contain only digits and an optional leading +/- sign.
A Result containing the parsed integer if successful, or an error if parsing fails.
Attempts to parse a number from a string using locale-specific formatting. Handles currency symbols, thousands separators, and locale-specific decimal separators.
The string to parse.
A Result containing the parsed number if successful, or an error if parsing fails.
StaticcreateCreates a DotNetLocaleSettings instance for the specified locale.
The locale name (e.g., "en-US", "fr-FR", "de-DE").
A new DotNetLocaleSettings instance configured for the specified locale.
StaticcreateCreates a DotNetLocaleSettings instance for the invariant culture (en-US). The invariant culture provides consistent formatting across all systems.
A new DotNetLocaleSettings instance configured for invariant culture.
Represents locale-specific formatting settings for dates, times, and numbers.
Provides culture-specific separators and formatting options that determine how numbers, currencies, dates, and times are formatted and parsed.
Example