Class RegionalSettings
The regional settings a number or a date is written in as text, and a String is read by when it is Let-coerced to a number or a date:
MS-VBAL §5.5.1.2.4's "active host-defined regional settings", and the window two-digit years are in.
public sealed record RegionalSettings : IEquatable<RegionalSettings>
- Inheritance
-
RegionalSettings
- Implements
- Inherited Members
Remarks
These are the platform's, set in its configuration (Regional), and not the machine's or the
culture's: a program writes and reads a number the same way wherever it runs, unless the platform is told otherwise. The default is en-US, which is what
MS-VBA writes and reads on an en-US machine (recorded in Excel): 1,000 is a thousand, $1 is one, 30 is the year 2030, and
CStr(2.5) is 2.5.
MS-VBA has one set of regional settings, the system's, which CStr writes in and CDbl and CDate read by: what one writes, the
other reads back. So these are both ways too, and the culture of the environment (its LCID) says nothing of how a number or a date is written.
🚧 A date is read by MS-VBAL §3.3.3's rules, which take an ambiguous one month first, whatever ShortDatePattern says.
Constructors
RegionalSettings(string, string, string, int)
The regional settings a number or a date is written in as text, and a String is read by when it is Let-coerced to a number or a date:
MS-VBAL §5.5.1.2.4's "active host-defined regional settings", and the window two-digit years are in.
public RegionalSettings(string DecimalSymbol, string DigitGroupingSymbol, string CurrencySymbol, int TwoDigitYearMax)
Parameters
DecimalSymbolstringWhat separates the whole part of a number from its fraction.
DigitGroupingSymbolstringWhat groups the digits of a number; ignored where it is read, after the first digit.
CurrencySymbolstringWhat a number may be written with before or after it, as an amount of money.
TwoDigitYearMaxintThe last year a year written with one or two digits can be: the hundred years ending with it are the ones such a year is in.
Remarks
These are the platform's, set in its configuration (Regional), and not the machine's or the
culture's: a program writes and reads a number the same way wherever it runs, unless the platform is told otherwise. The default is en-US, which is what
MS-VBA writes and reads on an en-US machine (recorded in Excel): 1,000 is a thousand, $1 is one, 30 is the year 2030, and
CStr(2.5) is 2.5.
MS-VBA has one set of regional settings, the system's, which CStr writes in and CDbl and CDate read by: what one writes, the
other reads back. So these are both ways too, and the culture of the environment (its LCID) says nothing of how a number or a date is written.
🚧 A date is read by MS-VBAL §3.3.3's rules, which take an ambiguous one month first, whatever ShortDatePattern says.
Properties
AMDesignator
What a time before noon is written with: AM by default.
public string AMDesignator { get; init; }
Property Value
CurrencySymbol
What a number may be written with before or after it, as an amount of money.
public string CurrencySymbol { get; init; }
Property Value
DateFormat
The formats a date is written in: ShortDatePattern and LongTimePattern, in the Gregorian calendar, with / and
: the separators they are written with.
public DateTimeFormatInfo DateFormat { get; }
Property Value
DecimalSymbol
What separates the whole part of a number from its fraction.
public string DecimalSymbol { get; init; }
Property Value
Default
The settings of en-US: ., ,, $, two-digit years up to 2049, and dates written M/d/yyyy h:mm:ss tt, as Windows has them
today.
public static RegionalSettings Default { get; }
Property Value
DigitGroupingSymbol
What groups the digits of a number; ignored where it is read, after the first digit.
public string DigitGroupingSymbol { get; init; }
Property Value
LongTimePattern
The Long Time format a time is written in, as a .NET custom time format: h:mm:ss tt by default.
public string LongTimePattern { get; init; }
Property Value
PMDesignator
What a time from noon on is written with: PM by default.
public string PMDesignator { get; init; }
Property Value
ShortDatePattern
The Short Date format a date is written in, as a .NET custom date format: M/d/yyyy by default.
public string ShortDatePattern { get; init; }
Property Value
TwoDigitYearMax
The last year a year written with one or two digits can be: the hundred years ending with it are the ones such a year is in.
public int TwoDigitYearMax { get; init; }