Version

CalcDefaultCurrencyMask Method

Calculates the default mask for currency based on the cultureInfo.
Syntax
'Declaration
 
Public Shared Function CalcDefaultCurrencyMask( _
   ByVal formatProvider As IFormatProvider, _
   ByVal integerDigits As Integer, _
   ByVal fractionDigits As Integer, _
   ByVal allowNegatives As Char, _
   ByVal includeCurrencySymbol As Boolean _
) As String
public static string CalcDefaultCurrencyMask( 
   IFormatProvider formatProvider,
   int integerDigits,
   int fractionDigits,
   char allowNegatives,
   bool includeCurrencySymbol
)

Parameters

formatProvider
Format provider to use to construct a default mask with. Can be a CultureInfo or a NumberFormatInfo instance.
integerDigits
Number of digits in integer section. -1 means use a default. Can be 0 in which case there won't be an integer portion.
fractionDigits
Number of digits in fraction section. -1 means use one specified by culture info. Can be 0 in which case there won't be fraction section.
allowNegatives
If '-' or '+' then negative numbers are allowed. '-' specifies that the minus sign should be displayed only when the number is negative. '+' specifies that the plus or minus sign will always be displayed depending on whther the number is negative or positive. If this parameter is any other character then it's ignored.
includeCurrencySymbol
Specifies whether the mask should include the currency symbol.

Return Value

Mask as a string.
Remarks

Typically there is no need for you to directly call this method. If the ValueType is set to Decimal the XamMaskedEditor and derived editors will call this method to calculate the mask if none has been explicitly set. Also if you want to explicitly set the mask to make use of culture sensitive currency mask then use one of the currency tokens as documented in the table listing all the mask tokens in the help for Mask property.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also