Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

CurrencyType

mattt edited this page Oct 30, 2020 · 3 revisions

CurrencyType

A monetary unit.

public protocol CurrencyType

Requirements

code

The three letter ISO 4217 currency code.

var code: String

name

The name of the currency.

var name: String

minorUnit

The number of decimal places used to express any minor units for the currency.

var minorUnit: Int

For example, the US Dollar (USD) has a minor unit (cents) equal to 1/100 of a dollar, and therefore takes 2 decimal places. The Japanese Yen (JPY) doesn't have a minor unit, and therefore takes 0 decimal places.

Clone this wiki locally