-
Notifications
You must be signed in to change notification settings - Fork 0
/
currency.go
207 lines (200 loc) · 5.84 KB
/
currency.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
package currency
type Currency struct {
Description string
Name string
Code uint16
}
var currencies []Currency = []Currency{
{"Lek", "ALL", 8},
{"Algerian Dinar", "DZD", 12},
{"Argentine Peso", "ARS", 32},
{"Australian Dollar", "AUD", 36},
{"Bahamian Dollar", "BSD", 44},
{"Bahraini Dinar", "BHD", 48},
{"Taka", "BDT", 50},
{"Armenian Dram", "AMD", 51},
{"Barbados Dollar", "BBD", 52},
{"Bermudian Dollar", "BMD", 60},
{"Ngultrum", "BTN", 64},
{"Boliviano", "BOB", 68},
{"Pula", "BWP", 72},
{"Belize Dollar", "BZD", 84},
{"Solomon Islands Dollar", "SBD", 90},
{"Brunei Dollar", "BND", 96},
{"Kyat", "MMK", 104},
{"Burundi Franc", "BIF", 108},
{"Riel", "KHR", 116},
{"Canadian Dollar", "CAD", 124},
{"Cabo Verde Escudo", "CVE", 132},
{"Cayman Islands Dollar", "KYD", 136},
{"Sri Lanka Rupee", "LKR", 144},
{"Chilean Peso", "CLP", 152},
{"Yuan Renminbi", "CNY", 156},
{"Colombian Peso", "COP", 170},
{"Comoro Franc", "KMF", 174},
{"Costa Rican Colon", "CRC", 188},
{"Kuna", "HRK", 191},
{"Cuban Peso", "CUP", 192},
{"Czech Koruna", "CZK", 203},
{"Danish Krone", "DKK", 208},
{"Dominican Peso", "DOP", 214},
{"El Salvador Colon", "SVC", 222},
{"Ethiopian Birr", "ETB", 230},
{"Nakfa", "ERN", 232},
{"Falkland Islands Pound", "FKP", 238},
{"Fiji Dollar", "FJD", 242},
{"Djibouti Franc", "DJF", 262},
{"Dalasi", "GMD", 270},
{"Gibraltar Pound", "GIP", 292},
{"Quetzal", "GTQ", 320},
{"Guinea Franc", "GNF", 324},
{"Guyana Dollar", "GYD", 328},
{"Gourde", "HTG", 332},
{"Lempira", "HNL", 340},
{"Hong Kong Dollar", "HKD", 344},
{"Forint", "HUF", 348},
{"Iceland Krona", "ISK", 352},
{"Indian Rupee", "INR", 356},
{"Indian Rupee", "INR", 356},
{"Rupiah", "IDR", 360},
{"Iranian Rial", "IRR", 364},
{"Iraqi Dinar", "IQD", 368},
{"New Israeli Sheqel", "ILS", 376},
{"Jamaican Dollar", "JMD", 388},
{"Yen", "JPY", 392},
{"Tenge", "KZT", 398},
{"Jordanian Dinar", "JOD", 400},
{"Kenyan Shilling", "KES", 404},
{"North Korean Won", "KPW", 408},
{"Won", "KRW", 410},
{"Kuwaiti Dinar", "KWD", 414},
{"Som", "KGS", 417},
{"Kip", "LAK", 418},
{"Lebanese Pound", "LBP", 422},
{"Loti", "LSL", 426},
{"Liberian Dollar", "LRD", 430},
{"Libyan Dinar", "LYD", 434},
{"Pataca", "MOP", 446},
{"Kwacha", "MWK", 454},
{"Malaysian Ringgit", "MYR", 458},
{"Rufiyaa", "MVR", 462},
{"Mauritius Rupee", "MUR", 480},
{"Mexican Peso", "MXN", 484},
{"Tugrik", "MNT", 496},
{"Moldovan Leu", "MDL", 498},
{"Moroccan Dirham", "MAD", 504},
{"Rial Omani", "OMR", 512},
{"Namibia Dollar", "NAD", 516},
{"Nepalese Rupee", "NPR", 524},
{"Netherlands Antillean Guilder", "ANG", 532},
{"Aruban Florin", "AWG", 533},
{"Vatu", "VUV", 548},
{"New Zealand Dollar", "NZD", 554},
{"Cordoba Oro", "NIO", 558},
{"Naira", "NGN", 566},
{"Norwegian Krone", "NOK", 578},
{"Pakistan Rupee", "PKR", 586},
{"Balboa", "PAB", 590},
{"Kina", "PGK", 598},
{"Guarani", "PYG", 600},
{"Nuevo Sol", "PEN", 604},
{"Philippine Peso", "PHP", 608},
{"Qatari Rial", "QAR", 634},
{"Russian Ruble", "RUB", 643},
{"Rwanda Franc", "RWF", 646},
{"Saint Helena Pound", "SHP", 654},
{"Saudi Riyal", "SAR", 682},
{"Seychelles Rupee", "SCR", 690},
{"Leone", "SLL", 694},
{"Singapore Dollar", "SGD", 702},
{"Dong", "VND", 704},
{"Somali Shilling", "SOS", 706},
{"Rand", "ZAR", 710},
{"South Sudanese Pound", "SSP", 728},
{"Lilangeni", "SZL", 748},
{"Swedish Krona", "SEK", 752},
{"Swiss Franc", "CHF", 756},
{"Syrian Pound", "SYP", 760},
{"Baht", "THB", 764},
{"Pa’anga", "TOP", 776},
{"Trinidad and Tobago Dollar", "TTD", 780},
{"UAE Dirham", "AED", 784},
{"Tunisian Dinar", "TND", 788},
{"Uganda Shilling", "UGX", 800},
{"Denar", "MKD", 807},
{"Egyptian Pound", "EGP", 818},
{"Pound Sterling", "GBP", 826},
{"Tanzanian Shilling", "TZS", 834},
{"US Dollar", "USD", 840},
{"Peso Uruguayo", "UYU", 858},
{"Uzbekistan Sum", "UZS", 860},
{"Tala", "WST", 882},
{"Yemeni Rial", "YER", 886},
{"New Taiwan Dollar", "TWD", 901},
{"Ouguiya", "MRU", 929},
{"Dobra", "STN", 930},
{"Peso Convertible", "CUC", 931},
{"Zimbabwe Dollar", "ZWL", 932},
{"Belarussian Ruble", "BYN", 933},
{"Turkmenistan New Manat", "TMT", 934},
{"Ghana Cedi", "GHS", 936},
{"Bolivar", "VEF", 937},
{"Sudanese Pound", "SDG", 938},
{"Uruguay Peso en Unidades Indexadas (URUIURUI)", "UYI", 940},
{"Serbian Dinar", "RSD", 941},
{"Mozambique Metical", "MZN", 943},
{"Azerbaijanian Manat", "AZN", 944},
{"Romanian Leu", "RON", 946},
{"WIR Euro", "CHE", 947},
{"WIR Franc", "CHW", 948},
{"Turkish Lira", "TRY", 949},
{"CFA Franc BEAC", "XAF", 950},
{"East Caribbean Dollar", "XCD", 951},
{"CFA Franc BCEAO", "XOF", 952},
{"CFP Franc", "XPF", 953},
{"SDR (Special Drawing Right)", "XDR", 960},
{"ADB Unit of Account", "XUA", 965},
{"Zambian Kwacha", "ZMW", 967},
{"Surinam Dollar", "SRD", 968},
{"Malagasy Ariary", "MGA", 969},
{"Unidad de Valor Real", "COU", 970},
{"Afghani", "AFN", 971},
{"Somoni", "TJS", 972},
{"Kwanza", "AOA", 973},
{"Bulgarian Lev", "BGN", 975},
{"Congolese Franc", "CDF", 976},
{"Convertible Mark", "BAM", 977},
{"Euro", "EUR", 978},
{"Mexican Unidad de Inversion (UDI)", "MXV", 979},
{"Hryvnia", "UAH", 980},
{"Lari", "GEL", 981},
{"Mvdol", "BOV", 984},
{"Zloty", "PLN", 985},
{"Brazilian Real", "BRL", 986},
{"Unidad de Fomento", "CLF", 990},
{"Sucre", "XSU", 994},
{"US Dollar (Next day)", "USN", 997},
}
func GetCurrencyList() []Currency {
return currencies
}
func GetCodeMap() map[uint16]string {
var curMap map[uint16]string = make(map[uint16]string, len(currencies))
for _, cur := range currencies {
curMap[cur.Code] = cur.Name
}
return curMap
}
func GetNameMap() map[string]uint16 {
var curMap map[string]uint16 = make(map[string]uint16, len(currencies))
for _, cur := range currencies {
curMap[cur.Name] = cur.Code
}
return curMap
}
func FindByCode(code uint16) string {
return GetCodeMap()[code]
}
func FindByName(name string) uint16 {
return GetNameMap()[name]
}