Enum MonetaryStyles
Determines the styles permitted when parsing a monetary string to a MonetaryValue value.
Namespace: Singulink.Globalization
Assembly: Singulink.Globalization.Currency.dll
Syntax
[Flags]
public enum MonetaryStyles
Remarks
Note that the order of precedence for parsing styles is as follows: AllowCurrencyCode, then AllowLocalSymbol, and lastly AllowUnambiguousSymbols.
This means that if all three flags are specified, the parser will first try to match what looks like the currency code or currency symbol to a currency code in the registry, then to the local currency symbol, and then to any other unambiguous non-local currency symbols in the registry.
Fields
Name | Description |
---|---|
AllowCurrencyCode | Indicates that the monetary string can use a currency code to indicate the currency. |
AllowDecimalPoint | Indicates that the numeric string can have a decimal point. If the NumberStyles value includes the AllowCurrencySymbol flag and the parsed string includes a currency symbol, the decimal separator character is determined by the CurrencyDecimalSeparator property. Otherwise, the decimal separator character is determined by the NumberDecimalSeparator property. |
AllowLeadingSign | Indicates that the numeric string can have a leading sign. Valid leading sign characters are determined by the PositiveSign and NegativeSign properties. |
AllowLeadingWhite | Indicates that leading white-space characters can be present in the parsed string. Valid white-space characters have the Unicode values U+0009, U+000A, U+000B, U+000C, U+000D, and U+0020. Note that this is a subset of the characters for which the IsWhiteSpace(char) method returns true. |
AllowLocalSymbol | Indicates that the monetary string can use the local currency symbol of the parsing culture's region to indicate that it is in the local currency. |
AllowParentheses | Indicates that the numeric string can have one pair of parentheses enclosing the number. The parentheses indicate that the string to be parsed represents a negative number. |
AllowThousands | Indicates that the numeric string can have group separators, such as symbols that separate hundreds from thousands. If the NumberStyles value includes the AllowCurrencySymbol flag and the string to be parsed includes a currency symbol, the valid group separator character is determined by the CurrencyGroupSeparator property, and the number of digits in each group is determined by the CurrencyGroupSizes property. Otherwise, the valid group separator character is determined by the NumberGroupSeparator property, and the number of digits in each group is determined by the NumberGroupSizes property. |
AllowTrailingSign | Indicates that the numeric string can have a trailing sign. Valid trailing sign characters are determined by the PositiveSign and NegativeSign properties. |
AllowTrailingWhite | Indicates that trailing white-space characters can be present in the parsed string. Valid white-space characters have the Unicode values U+0009, U+000A, U+000B, U+000C, U+000D, and U+0020. Note that this is a subset of the characters for which the IsWhiteSpace(char) method returns true. |
AllowUnambiguousSymbols | Indicates that the monetary string can use any currency symbol in the registry to indicate the currency as long as the symbol does not match with multiple currencies. |
Any | Indicates that all styles are used. This is a composite monetary format style. |
CurrencyCode | Indicates that the AllowCurrencyCode, AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowParentheses, AllowDecimalPoint and AllowThousands styles are used. This is a composite monetary format style. |
CurrencyCodeOrLocalSymbol | Indicates that the AllowCurrencyCode, AllowLocalSymbol, AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowParentheses, AllowDecimalPoint and AllowThousands styles are used. This is a composite monetary format style. |
CurrencyCodeOrUnambiguousSymbols | Indicates that the AllowCurrencyCode, AllowUnambiguousSymbols, AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowParentheses, AllowDecimalPoint and AllowThousands styles are used. This is a composite monetary format style. |
LocalSymbol | Indicates that the AllowLocalSymbol, AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowParentheses, AllowDecimalPoint and AllowThousands styles are used. This is a composite monetary format style. |
UnambiguousSymbols | Indicates that the AllowUnambiguousSymbols, AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowParentheses, AllowDecimalPoint and AllowThousands styles are used. This is a composite monetary format style. |