Class Currency
- Namespace
- HeroKit.Globalization
- Assembly
- HeroKit.dll
A currency with its notation and names. Predefined currencies are in Currencies.
public sealed class Currency
- Inheritance
-
Currency
- Inherited Members
- Extension Methods
Remarks
Formatting uses the separators of this instance, not ICU culture data, so the output is the same on every system. Create your own instance for other currencies or for unit names in another language.
Constructors
Currency(string, string, Language)
A currency with its notation and names. Predefined currencies are in Currencies.
public Currency(string isoCode, string symbol, Language language)
Parameters
isoCodestringThe ISO 4217 code, for example "TRY".
symbolstringThe symbol, for example "₺".
languageLanguageThe language of UnitName and SubunitName and of amounts in words.
Remarks
Formatting uses the separators of this instance, not ICU culture data, so the output is the same on every system. Create your own instance for other currencies or for unit names in another language.
Properties
Abbreviation
Gets the local abbreviation, for example "TL". Defaults to the ISO code.
public string Abbreviation { get; init; }
Property Value
DecimalSeparator
Gets the decimal separator. Defaults to ".".
public string DecimalSeparator { get; init; }
Property Value
GroupSeparator
Gets the group separator. Defaults to ",".
public string GroupSeparator { get; init; }
Property Value
IsoCode
Gets the ISO 4217 code.
public string IsoCode { get; }
Property Value
Language
Gets the language of the unit names and of amounts in words.
public Language Language { get; }
Property Value
SubunitConjunction
Gets the word between the unit and the subunit in amounts in words, for example "and". Empty by default.
public string SubunitConjunction { get; init; }
Property Value
SubunitName
Gets the name of the subunit (1/100) in Language, for example "kuruş".
public string SubunitName { get; init; }
Property Value
SubunitNamePlural
Gets the plural of SubunitName, for example "cents". Null when the language does not inflect the subunit after numbers.
public string? SubunitNamePlural { get; init; }
Property Value
Symbol
Gets the symbol.
public string Symbol { get; }
Property Value
UnitName
Gets the name of the main unit in Language, for example "Türk lirası".
public string UnitName { get; init; }
Property Value
UnitNamePlural
Gets the plural of UnitName, for example "dollars". Null when the language does not inflect the unit after numbers.
public string? UnitNamePlural { get; init; }
Property Value
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.