Class DisplayFormats
Pass these constants to the ToString method on an object of the appropriate type to render the object for printing.
The comment associated with each constant identifies the types for which it is appropriate.
There are service methods to facilitate using the Date/Time formatting constants, which cannot be fed to ToString, except, perhaps, with a custom formatting engine. Use these service methods, or call the ReformatSysDate function, which also belongs to this library, directly.
NOTE: The time formatting strings and routines in this class are time zone agnostic. If you want or need the time zone, use the companion method, GetDisplayTimeZone, defined in sibling class Util.
Inheritance
Inherited Members
Namespace: WizardWrx
Assembly: WizardWrx.Common.dll
Syntax
public static class DisplayFormats
Fields
| Improve this Doc View SourceHEXADECIMAL_16
Pass this constant to the ToString method on any integral type to format it as a string of 16 hexadecimal digits.
Declaration
public const string HEXADECIMAL_16 = "X16"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_2
Pass this constant to the ToString method on any integral type to format it as a string of 2 hexadecimal digits.
Declaration
public const string HEXADECIMAL_2 = "X2"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_4
Pass this constant to the ToString method on any integral type to format it as a string of 4 hexadecimal digits.
Declaration
public const string HEXADECIMAL_4 = "X4"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_8
Pass this constant to the ToString method on any integral type to format it as a string of 8 hexadecimal digits.
Declaration
public const string HEXADECIMAL_8 = "X8"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_LC
Pass this constant to the ToString method on any integral type to format it as an arbitrary string of hexadecimal digits, using lower case glyphs..
Declaration
public const string HEXADECIMAL_LC = "x"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_PREFIX_0H_LC
Substitute this into a format string as a prefix to a hexadecimal number display. This string renders exactly as shown, 0h.
Declaration
public const string HEXADECIMAL_PREFIX_0H_LC = "0h"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_PREFIX_0H_UC
Substitute this into a format string as a prefix to a hexadecimal number display. This string renders exactly as shown, 0H.
Declaration
public const string HEXADECIMAL_PREFIX_0H_UC = "0H"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_PREFIX_0X_LC
Substitute this into a format string as a prefix to a hexadecimal number display. This string renders exactly as shown, 0x.
Declaration
public const string HEXADECIMAL_PREFIX_0X_LC = "0x"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_PREFIX_0X_UC
Substitute this into a format string as a prefix to a hexadecimal number display. This string renders exactly as shown, 0X.
Declaration
public const string HEXADECIMAL_PREFIX_0X_UC = "0X"
Field Value
Type | Description |
---|---|
System.String |
HEXADECIMAL_UC
Pass this constant to the ToString method on any integral type to format it as an arbitrary string of hexadecimal digits, using upper case glyphs..
Declaration
public const string HEXADECIMAL_UC = "X"
Field Value
Type | Description |
---|---|
System.String |
INTEGER_PER_REG_SETTINGS
Use this string to format an integer per the Regional Settings applet in the Windows Control Panel, overriding its default setting for digits after the decimal point, which is meaningless for an integer.
Declaration
public const string INTEGER_PER_REG_SETTINGS = "N0"
Field Value
Type | Description |
---|---|
System.String |
NUMBER_PER_REG_SETTINGS
Pass this constant to the ToString method on any integral type to format it according to the current settings in the Regional Settings part of the Windows Control Panel.
This format string causes the formatting engine to obey ALL of the settings, including the number of digits to display after the decimal point for a whole number.
Declaration
public const string NUMBER_PER_REG_SETTINGS = "N"
Field Value
Type | Description |
---|---|
System.String |
NUMBER_PER_REG_SETTINGS_0D
Pass this constant to the ToString method on any integral type to format it according to the current settings in the Regional Settings part of the Windows Control Panel.
This format string causes the formatting engine to obey all of the settings, EXCEPT the number of digits to display after the decimal point for a whole number.
This format string overrides the digits after decimal value specified by the iDigits value of Windows Registry key HKCU\Control Panel\International, causing it to behave as if it had been set to 0.
The override applies only to the instance ToString method being called; the Registry is unchanged.
See http://technet.microsoft.com/en-us/library/cc978638.aspx.
Declaration
public const string NUMBER_PER_REG_SETTINGS_0D = "N0"
Field Value
Type | Description |
---|---|
System.String |
NUMBER_PER_REG_SETTINGS_2D
Pass this constant to the ToString method on any integral type to format it according to the current settings in the Regional Settings part of the Windows Control Panel.
This format string causes the formatting engine to obey all of the settings, EXCEPT the number of digits to display after the decimal point for a whole number.
This format string overrides the digits after decimal value specified by the iDigits value of Windows Registry key HKCU\Control Panel\International, causing it to behave as if it had been set to 2, which happens to be the default for a US installation. Nevertheless, uses this value if changes made by the user would mess up your work.
The override applies only to the instance ToString method being called; the Registry is unchanged.
See http://technet.microsoft.com/en-us/library/cc978638.aspx.
Declaration
public const string NUMBER_PER_REG_SETTINGS_2D = "N2"
Field Value
Type | Description |
---|---|
System.String |
NUMBER_PER_REG_SETTINGS_3D
Pass this constant to the ToString method on any integral type to format it according to the current settings in the Regional Settings part of the Windows Control Panel.
This format string causes the formatting engine to obey all of the settings, EXCEPT the number of digits to display after the decimal point for a whole number.
This format string overrides the digits after decimal value specified by the iDigits value of Windows Registry key HKCU\Control Panel\International, causing it to behave as if it had been set to 3.
The override applies only to the instance ToString method being called; the Registry is unchanged.
See http://technet.microsoft.com/en-us/library/cc978638.aspx.
Declaration
public const string NUMBER_PER_REG_SETTINGS_3D = "N3"
Field Value
Type | Description |
---|---|
System.String |
PERCENT
Pass this constant to the ToString method on a single or double precision floating point number to be displayed as an integral percentage.
Declaration
public const string PERCENT = "P"
Field Value
Type | Description |
---|---|
System.String |
PERCENT_DIGITS_2
Pass this constant to the ToString method on a single or double precision floating point number to be displayed as a fixed point percentage, accurate to two decimal places.
Declaration
public const string PERCENT_DIGITS_2 = "P2"
Field Value
Type | Description |
---|---|
System.String |