Table of Contents

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

isoCode string

The ISO 4217 code, for example "TRY".

symbol string

The symbol, for example "₺".

language Language

The 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

string

DecimalSeparator

Gets the decimal separator. Defaults to ".".

public string DecimalSeparator { get; init; }

Property Value

string

GroupSeparator

Gets the group separator. Defaults to ",".

public string GroupSeparator { get; init; }

Property Value

string

IsoCode

Gets the ISO 4217 code.

public string IsoCode { get; }

Property Value

string

Language

Gets the language of the unit names and of amounts in words.

public Language Language { get; }

Property Value

Language

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

string

SubunitName

Gets the name of the subunit (1/100) in Language, for example "kuruş".

public string SubunitName { get; init; }

Property Value

string

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

string

Symbol

Gets the symbol.

public string Symbol { get; }

Property Value

string

UnitName

Gets the name of the main unit in Language, for example "Türk lirası".

public string UnitName { get; init; }

Property Value

string

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

string

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.