ISO4217Currency class

A class representing an ISO 4217 currency.

The ISO4217Currency class is used to define a currency based on its ISO 4217 code standard. It stores essential information such as the currency code, numeric code, number of decimal digits, currency name, and the list of locations that use the currency.

This class can be used for financial applications, currency conversion services, and anywhere the ISO 4217 currency codes are required.

ISO 4217:

ISO 4217 is the international standard for currency codes. It defines three-letter (alphabetic) codes, three-digit (numeric) codes, and the number of decimal digits for each currency in use. The standard is maintained by the International Organization for Standardization (ISO).

Source: https://en.wikipedia.org/wiki/ISO_4217 | https://www.iso.org/iso-4217-currency-codes.html

Example:

final usd = ISO4217Currency(
  code: 'USD',
  numCode: 840,
  digits: 2,
  currencyName: 'United States Dollar',
  locations: ['United States', 'American Samoa', 'British Virgin Islands'],
);

Constructors

ISO4217Currency.new({required String code, required int numCode, required int digits, required String currencyName, required List<String> locations})
Creates a new instance of ISO4217Currency.
ISO4217Currency.fromJson(Map<String, dynamic> json)
Creates an ISO4217Currency instance from a JSON object.
factory
ISO4217Currency.fromNumCodetoObject(String code)
Creates an ISO4217Currency instance from an ISO 4217 3-letter currency code.
factory

Properties

code String
The ISO 4217 code of the currency (3-letter code).
final
currencyName String
The full name of the currency.
final
digits int
The number of decimal digits used in the currency.
final
hashCode int
The hash code for this object.
no setterinherited
locations List<String>
A list of locations (countries or regions) that use this currency.
final
numCode int
The numeric code associated with the currency (3-digit code).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

logDebugingCurrency() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts an ISO4217Currency instance to a JSON object.
toRawNumCode() String
Converts an ISO4217Currency instance to a raw code string.
toString() String
Returns a string representation of the currency.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getCurrencyByCode(String code) Map<String, dynamic>
Retrieves a currency based on its ISO 4217 code.
getCurrencyByNumCode(String code) Map<String, dynamic>
Retrieves a currency based on its ISO 4217 numeric code.