Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Struct

Currency

struct Currency

Module: System.Globalization
Assembly: System.Runtime.dll
Source file: Currency.rvn

Inheritance: Object → ValueType → Currency
Implements: EquatableTo<Currency>

Immutable currency identity. Culture changes presentation, never the currency or amount. The bounded catalog contains SEK, ILS, GBP, USD, EUR, JPY and unspecified XXX.

Properties

9 items
Code: string ISO 4217 identifier; XXX means that no currency has been specified.
DecimalDigits: int Default display precision: zero for JPY, two for the other supported identities. This does not constrain Decimal storage or specify cash rounding.
Static member: EUR: Currency Euro.
Static member: GBP: Currency Pound sterling.
Static member: ILS: Currency Israeli new shekel.
Static member: JPY: Currency Japanese yen.
Static member: SEK: Currency Swedish krona.
Static member: Unspecified: Currency Unspecified currency (XXX), also the default value and invariant formatting policy.
Static member: USD: Currency United States dollar.

Methods

10 items
Equals(other: Currency) -> bool Tests currency identity, independently of culture and presentation. Implements EquatableTo<Currency>.Equals
Equals(other: object?) -> bool Tests boxed currency identity. Overrides Object.Equals
Format(amount: decimal, culture: Culture) -> string Formats an amount using this currency's display precision and explicit culture. Display rounding leaves the input unchanged; no conversion or cash rounding occurs.
Format(amount: decimal, precision: int, culture: Culture) -> string Formats with explicit fractional precision from zero through 99; invalid precision faults.
GetHashCode() -> int Returns the identity hash. Overrides Object.GetHashCode
GetSymbol(culture: Culture) -> string Returns the bounded locale's symbol, falling back to the unambiguous ISO code.
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Static member: Parse(code: string) -> Result<Currency, CurrencyError> Parses an exact uppercase code from the bounded catalog; unsupported codes are errors.
ParseAmount(text: string, culture: Culture) -> Result<Money, NumberParseError> Parses an amount with this expected currency and exact culture punctuation. Currency symbols/codes must match; an ambiguous symbol never selects another currency.
ToString() -> string Returns the ISO code; no culture or currency symbol is inferred. Overrides Object.ToString

Operators

2 items
Static member: operator ==(left: Currency, right: Currency) -> bool No summary available.
Static member: operator !=(left: Currency, right: Currency) -> bool No summary available.