Skip to content

Commit 0eba7da

Browse files
authored
Merge pull request #1 from memobank/add-more-currencies
Add XAF, XOF and XPF currencies
2 parents dbce8a7 + 62ae60a commit 0eba7da

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sources/Money/Currency.swift: Resources/iso4217.csv
22

33
%.swift: %.swift.gyb
4-
@gyb --line-directive '' -o $@ $<
4+
@./gyb --line-directive '' -o $@ $<
55

66
.PHONY:
77
clean:

Resources/iso4217.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ VEF,Bolívar,2
155155
VND,Dong,0
156156
VUV,Vatu,0
157157
WST,Tala,2
158+
XAF,CFA franc BEAC,0
158159
XCD,East Caribbean Dollar,2
160+
XOF,CFA franc BCEAO,0
161+
XPF,CFP franc (franc Pacifique),0
159162
YER,Yemeni Rial,2
160163
ZAR,Rand,2
161164
ZMW,Zambian Kwacha,2

Sources/Money/Currency.swift

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ public func iso4217Currency(for code: String) -> CurrencyType.Type? {
193193
case "VND": return VND.self
194194
case "VUV": return VUV.self
195195
case "WST": return WST.self
196+
case "XAF": return XAF.self
196197
case "XCD": return XCD.self
198+
case "XOF": return XOF.self
199+
case "XPF": return XPF.self
197200
case "YER": return YER.self
198201
case "ZAR": return ZAR.self
199202
case "ZMW": return ZMW.self
@@ -2543,6 +2546,21 @@ public enum WST: CurrencyType {
25432546
}
25442547
}
25452548

2549+
/// CFA franc BEAC (XAF)
2550+
public enum XAF: CurrencyType {
2551+
public static var code: String {
2552+
return "XAF"
2553+
}
2554+
2555+
public static var name: String {
2556+
return "CFA franc BEAC"
2557+
}
2558+
2559+
public static var minorUnit: Int {
2560+
return 0
2561+
}
2562+
}
2563+
25462564
/// East Caribbean Dollar (XCD)
25472565
public enum XCD: CurrencyType {
25482566
public static var code: String {
@@ -2558,6 +2576,36 @@ public enum XCD: CurrencyType {
25582576
}
25592577
}
25602578

2579+
/// CFA franc BCEAO (XOF)
2580+
public enum XOF: CurrencyType {
2581+
public static var code: String {
2582+
return "XOF"
2583+
}
2584+
2585+
public static var name: String {
2586+
return "CFA franc BCEAO"
2587+
}
2588+
2589+
public static var minorUnit: Int {
2590+
return 0
2591+
}
2592+
}
2593+
2594+
/// CFP franc (franc Pacifique) (XPF)
2595+
public enum XPF: CurrencyType {
2596+
public static var code: String {
2597+
return "XPF"
2598+
}
2599+
2600+
public static var name: String {
2601+
return "CFP franc (franc Pacifique)"
2602+
}
2603+
2604+
public static var minorUnit: Int {
2605+
return 0
2606+
}
2607+
}
2608+
25612609
/// Yemeni Rial (YER)
25622610
public enum YER: CurrencyType {
25632611
public static var code: String {

0 commit comments

Comments
 (0)