C# Class NContrib.International.Currency

Datei anzeigen Open project: veracross/ncontrib

Public Properties

Property Type Description
BuiltInCurrencies CurrencyCollection

Public Methods

Method Description
AmountToImpliedDecimal ( decimal amount ) : int

Takes an amount and converts it to an implied decimal integer.

Currency ( string code, string numericCode, int minorUnit = 2, string englishName = null, string formatCulture = null ) : System
FormatAmount ( decimal amount, string overrideCulture = null ) : string

Formats an amount in an appropriate way for this currency's culture When no culture is available for the currency, format with invariant decimal formating plus the currency code

GetById ( string currencyId ) : Currency

Get a Currency object by the 3-char or 3-digit currency code

IsValidIdentifier ( string currencyId ) : bool

Test if the given identifier is valid. Must be 3 letters or 3 numbers

ToString ( ) : string

Returns the currency 3-character code

Method Details

AmountToImpliedDecimal() public method

Takes an amount and converts it to an implied decimal integer.
public AmountToImpliedDecimal ( decimal amount ) : int
amount decimal
return int

Currency() public method

public Currency ( string code, string numericCode, int minorUnit = 2, string englishName = null, string formatCulture = null ) : System
code string
numericCode string
minorUnit int
englishName string
formatCulture string
return System

FormatAmount() public method

Formats an amount in an appropriate way for this currency's culture When no culture is available for the currency, format with invariant decimal formating plus the currency code
public FormatAmount ( decimal amount, string overrideCulture = null ) : string
amount decimal
overrideCulture string Optional override culture formatting. For example using en-IE for formatting Euros instead of the default de-DE
return string

GetById() public static method

Get a Currency object by the 3-char or 3-digit currency code
public static GetById ( string currencyId ) : Currency
currencyId string
return Currency

IsValidIdentifier() public static method

Test if the given identifier is valid. Must be 3 letters or 3 numbers
public static IsValidIdentifier ( string currencyId ) : bool
currencyId string
return bool

ToString() public method

Returns the currency 3-character code
public ToString ( ) : string
return string

Property Details

BuiltInCurrencies public_oe static_oe property

public static CurrencyCollection BuiltInCurrencies
return CurrencyCollection