-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstd.go
More file actions
792 lines (778 loc) · 23.8 KB
/
std.go
File metadata and controls
792 lines (778 loc) · 23.8 KB
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
package currency
/*-------------------------------+
| Code generated by std_currency |
| DO NOT EDIT |
+-------------------------------*/
import "fmt"
// Currency defines a currency containing
// It's code, taken from the constants above
// as well as it's minor units, as an integer.
type Currency struct {
code string
minorUnits int
factor int
name string
}
// Code returns the currency code to the user
func (c *Currency) Code() string { return c.code }
// MinorUnits returns the minor unit to the user
func (c *Currency) MinorUnits() int { return c.minorUnits }
// Name returns the currency name as defined in the ISO.
func (c *Currency) Name() string { return c.name }
// Factor returns the factor by which a float should be multiplied
// to get back to it's smallest denomination
//
// Example:
//
// pence := 100.00 * currency.GBP.Factor()
func (c *Currency) Factor() int { return c.factor }
// FactorI64 returns the factor, converted to a int64
func (c *Currency) FactorI64() int64 { return int64(c.factor) }
// FactorF64 returns the factor, converted to a float64
func (c *Currency) FactorF64() float64 { return float64(c.factor) }
// Get returns a currency struct if the provided
// code is contained within the valid codes. Otherwise
// an error will be returned
func Get(code string) (*Currency, error) {
if Valid(code) {
val, ok := currencies[code]
if ok {
return &val, nil
}
}
return nil, fmt.Errorf("currency: could not find currency with code: %q", code)
}
// Valid checks if a provided code is contained
// inside the provided ValidCodes slice
func Valid(code string) bool {
for _, c := range ValidCodes {
if c == code {
return true
}
}
return false
}
// Following are all the structs containing currency data
var (
// AED currency struct
AED = Currency{code: "AED", minorUnits: 2, factor: 100, name: "UAE Dirham"}
// AFN currency struct
AFN = Currency{code: "AFN", minorUnits: 2, factor: 100, name: "Afghani"}
// ALL currency struct
ALL = Currency{code: "ALL", minorUnits: 2, factor: 100, name: "Lek"}
// AMD currency struct
AMD = Currency{code: "AMD", minorUnits: 2, factor: 100, name: "Armenian Dram"}
// ANG currency struct
ANG = Currency{code: "ANG", minorUnits: 2, factor: 100, name: "Netherlands Antillean Guilder"}
// AOA currency struct
AOA = Currency{code: "AOA", minorUnits: 2, factor: 100, name: "Kwanza"}
// ARS currency struct
ARS = Currency{code: "ARS", minorUnits: 2, factor: 100, name: "Argentine Peso"}
// AUD currency struct
AUD = Currency{code: "AUD", minorUnits: 2, factor: 100, name: "Australian Dollar"}
// AWG currency struct
AWG = Currency{code: "AWG", minorUnits: 2, factor: 100, name: "Aruban Florin"}
// AZN currency struct
AZN = Currency{code: "AZN", minorUnits: 2, factor: 100, name: "Azerbaijan Manat"}
// BAM currency struct
BAM = Currency{code: "BAM", minorUnits: 2, factor: 100, name: "Convertible Mark"}
// BBD currency struct
BBD = Currency{code: "BBD", minorUnits: 2, factor: 100, name: "Barbados Dollar"}
// BDT currency struct
BDT = Currency{code: "BDT", minorUnits: 2, factor: 100, name: "Taka"}
// BGN currency struct
BGN = Currency{code: "BGN", minorUnits: 2, factor: 100, name: "Bulgarian Lev"}
// BHD currency struct
BHD = Currency{code: "BHD", minorUnits: 3, factor: 1000, name: "Bahraini Dinar"}
// BIF currency struct
BIF = Currency{code: "BIF", minorUnits: 0, factor: 1, name: "Burundi Franc"}
// BMD currency struct
BMD = Currency{code: "BMD", minorUnits: 2, factor: 100, name: "Bermudian Dollar"}
// BND currency struct
BND = Currency{code: "BND", minorUnits: 2, factor: 100, name: "Brunei Dollar"}
// BOB currency struct
BOB = Currency{code: "BOB", minorUnits: 2, factor: 100, name: "Boliviano"}
// BOV currency struct
BOV = Currency{code: "BOV", minorUnits: 2, factor: 100, name: "Mvdol"}
// BRL currency struct
BRL = Currency{code: "BRL", minorUnits: 2, factor: 100, name: "Brazilian Real"}
// BSD currency struct
BSD = Currency{code: "BSD", minorUnits: 2, factor: 100, name: "Bahamian Dollar"}
// BTN currency struct
BTN = Currency{code: "BTN", minorUnits: 2, factor: 100, name: "Ngultrum"}
// BWP currency struct
BWP = Currency{code: "BWP", minorUnits: 2, factor: 100, name: "Pula"}
// BYN currency struct
BYN = Currency{code: "BYN", minorUnits: 2, factor: 100, name: "Belarusian Ruble"}
// BZD currency struct
BZD = Currency{code: "BZD", minorUnits: 2, factor: 100, name: "Belize Dollar"}
// CAD currency struct
CAD = Currency{code: "CAD", minorUnits: 2, factor: 100, name: "Canadian Dollar"}
// CDF currency struct
CDF = Currency{code: "CDF", minorUnits: 2, factor: 100, name: "Congolese Franc"}
// CHE currency struct
CHE = Currency{code: "CHE", minorUnits: 2, factor: 100, name: "WIR Euro"}
// CHF currency struct
CHF = Currency{code: "CHF", minorUnits: 2, factor: 100, name: "Swiss Franc"}
// CHW currency struct
CHW = Currency{code: "CHW", minorUnits: 2, factor: 100, name: "WIR Franc"}
// CLF currency struct
CLF = Currency{code: "CLF", minorUnits: 4, factor: 10000, name: "Unidad de Fomento"}
// CLP currency struct
CLP = Currency{code: "CLP", minorUnits: 0, factor: 1, name: "Chilean Peso"}
// CNY currency struct
CNY = Currency{code: "CNY", minorUnits: 2, factor: 100, name: "Yuan Renminbi"}
// COP currency struct
COP = Currency{code: "COP", minorUnits: 2, factor: 100, name: "Colombian Peso"}
// COU currency struct
COU = Currency{code: "COU", minorUnits: 2, factor: 100, name: "Unidad de Valor Real"}
// CRC currency struct
CRC = Currency{code: "CRC", minorUnits: 2, factor: 100, name: "Costa Rican Colon"}
// CUC currency struct
CUC = Currency{code: "CUC", minorUnits: 2, factor: 100, name: "Peso Convertible"}
// CUP currency struct
CUP = Currency{code: "CUP", minorUnits: 2, factor: 100, name: "Cuban Peso"}
// CVE currency struct
CVE = Currency{code: "CVE", minorUnits: 2, factor: 100, name: "Cabo Verde Escudo"}
// CZK currency struct
CZK = Currency{code: "CZK", minorUnits: 2, factor: 100, name: "Czech Koruna"}
// DJF currency struct
DJF = Currency{code: "DJF", minorUnits: 0, factor: 1, name: "Djibouti Franc"}
// DKK currency struct
DKK = Currency{code: "DKK", minorUnits: 2, factor: 100, name: "Danish Krone"}
// DOP currency struct
DOP = Currency{code: "DOP", minorUnits: 2, factor: 100, name: "Dominican Peso"}
// DZD currency struct
DZD = Currency{code: "DZD", minorUnits: 2, factor: 100, name: "Algerian Dinar"}
// EGP currency struct
EGP = Currency{code: "EGP", minorUnits: 2, factor: 100, name: "Egyptian Pound"}
// ERN currency struct
ERN = Currency{code: "ERN", minorUnits: 2, factor: 100, name: "Nakfa"}
// ETB currency struct
ETB = Currency{code: "ETB", minorUnits: 2, factor: 100, name: "Ethiopian Birr"}
// EUR currency struct
EUR = Currency{code: "EUR", minorUnits: 2, factor: 100, name: "Euro"}
// FJD currency struct
FJD = Currency{code: "FJD", minorUnits: 2, factor: 100, name: "Fiji Dollar"}
// FKP currency struct
FKP = Currency{code: "FKP", minorUnits: 2, factor: 100, name: "Falkland Islands Pound"}
// GBP currency struct
GBP = Currency{code: "GBP", minorUnits: 2, factor: 100, name: "Pound Sterling"}
// GEL currency struct
GEL = Currency{code: "GEL", minorUnits: 2, factor: 100, name: "Lari"}
// GHS currency struct
GHS = Currency{code: "GHS", minorUnits: 2, factor: 100, name: "Ghana Cedi"}
// GIP currency struct
GIP = Currency{code: "GIP", minorUnits: 2, factor: 100, name: "Gibraltar Pound"}
// GMD currency struct
GMD = Currency{code: "GMD", minorUnits: 2, factor: 100, name: "Dalasi"}
// GNF currency struct
GNF = Currency{code: "GNF", minorUnits: 0, factor: 1, name: "Guinean Franc"}
// GTQ currency struct
GTQ = Currency{code: "GTQ", minorUnits: 2, factor: 100, name: "Quetzal"}
// GYD currency struct
GYD = Currency{code: "GYD", minorUnits: 2, factor: 100, name: "Guyana Dollar"}
// HKD currency struct
HKD = Currency{code: "HKD", minorUnits: 2, factor: 100, name: "Hong Kong Dollar"}
// HNL currency struct
HNL = Currency{code: "HNL", minorUnits: 2, factor: 100, name: "Lempira"}
// HTG currency struct
HTG = Currency{code: "HTG", minorUnits: 2, factor: 100, name: "Gourde"}
// HUF currency struct
HUF = Currency{code: "HUF", minorUnits: 2, factor: 100, name: "Forint"}
// IDR currency struct
IDR = Currency{code: "IDR", minorUnits: 2, factor: 100, name: "Rupiah"}
// ILS currency struct
ILS = Currency{code: "ILS", minorUnits: 2, factor: 100, name: "New Israeli Sheqel"}
// INR currency struct
INR = Currency{code: "INR", minorUnits: 2, factor: 100, name: "Indian Rupee"}
// IQD currency struct
IQD = Currency{code: "IQD", minorUnits: 3, factor: 1000, name: "Iraqi Dinar"}
// IRR currency struct
IRR = Currency{code: "IRR", minorUnits: 2, factor: 100, name: "Iranian Rial"}
// ISK currency struct
ISK = Currency{code: "ISK", minorUnits: 0, factor: 1, name: "Iceland Krona"}
// JMD currency struct
JMD = Currency{code: "JMD", minorUnits: 2, factor: 100, name: "Jamaican Dollar"}
// JOD currency struct
JOD = Currency{code: "JOD", minorUnits: 3, factor: 1000, name: "Jordanian Dinar"}
// JPY currency struct
JPY = Currency{code: "JPY", minorUnits: 0, factor: 1, name: "Yen"}
// KES currency struct
KES = Currency{code: "KES", minorUnits: 2, factor: 100, name: "Kenyan Shilling"}
// KGS currency struct
KGS = Currency{code: "KGS", minorUnits: 2, factor: 100, name: "Som"}
// KHR currency struct
KHR = Currency{code: "KHR", minorUnits: 2, factor: 100, name: "Riel"}
// KMF currency struct
KMF = Currency{code: "KMF", minorUnits: 0, factor: 1, name: "Comorian Franc "}
// KPW currency struct
KPW = Currency{code: "KPW", minorUnits: 2, factor: 100, name: "North Korean Won"}
// KRW currency struct
KRW = Currency{code: "KRW", minorUnits: 0, factor: 1, name: "Won"}
// KWD currency struct
KWD = Currency{code: "KWD", minorUnits: 3, factor: 1000, name: "Kuwaiti Dinar"}
// KYD currency struct
KYD = Currency{code: "KYD", minorUnits: 2, factor: 100, name: "Cayman Islands Dollar"}
// KZT currency struct
KZT = Currency{code: "KZT", minorUnits: 2, factor: 100, name: "Tenge"}
// LAK currency struct
LAK = Currency{code: "LAK", minorUnits: 2, factor: 100, name: "Lao Kip"}
// LBP currency struct
LBP = Currency{code: "LBP", minorUnits: 2, factor: 100, name: "Lebanese Pound"}
// LKR currency struct
LKR = Currency{code: "LKR", minorUnits: 2, factor: 100, name: "Sri Lanka Rupee"}
// LRD currency struct
LRD = Currency{code: "LRD", minorUnits: 2, factor: 100, name: "Liberian Dollar"}
// LSL currency struct
LSL = Currency{code: "LSL", minorUnits: 2, factor: 100, name: "Loti"}
// LYD currency struct
LYD = Currency{code: "LYD", minorUnits: 3, factor: 1000, name: "Libyan Dinar"}
// MAD currency struct
MAD = Currency{code: "MAD", minorUnits: 2, factor: 100, name: "Moroccan Dirham"}
// MDL currency struct
MDL = Currency{code: "MDL", minorUnits: 2, factor: 100, name: "Moldovan Leu"}
// MGA currency struct
MGA = Currency{code: "MGA", minorUnits: 2, factor: 100, name: "Malagasy Ariary"}
// MKD currency struct
MKD = Currency{code: "MKD", minorUnits: 2, factor: 100, name: "Denar"}
// MMK currency struct
MMK = Currency{code: "MMK", minorUnits: 2, factor: 100, name: "Kyat"}
// MNT currency struct
MNT = Currency{code: "MNT", minorUnits: 2, factor: 100, name: "Tugrik"}
// MOP currency struct
MOP = Currency{code: "MOP", minorUnits: 2, factor: 100, name: "Pataca"}
// MRU currency struct
MRU = Currency{code: "MRU", minorUnits: 2, factor: 100, name: "Ouguiya"}
// MUR currency struct
MUR = Currency{code: "MUR", minorUnits: 2, factor: 100, name: "Mauritius Rupee"}
// MVR currency struct
MVR = Currency{code: "MVR", minorUnits: 2, factor: 100, name: "Rufiyaa"}
// MWK currency struct
MWK = Currency{code: "MWK", minorUnits: 2, factor: 100, name: "Malawi Kwacha"}
// MXN currency struct
MXN = Currency{code: "MXN", minorUnits: 2, factor: 100, name: "Mexican Peso"}
// MXV currency struct
MXV = Currency{code: "MXV", minorUnits: 2, factor: 100, name: "Mexican Unidad de Inversion (UDI)"}
// MYR currency struct
MYR = Currency{code: "MYR", minorUnits: 2, factor: 100, name: "Malaysian Ringgit"}
// MZN currency struct
MZN = Currency{code: "MZN", minorUnits: 2, factor: 100, name: "Mozambique Metical"}
// NAD currency struct
NAD = Currency{code: "NAD", minorUnits: 2, factor: 100, name: "Namibia Dollar"}
// NGN currency struct
NGN = Currency{code: "NGN", minorUnits: 2, factor: 100, name: "Naira"}
// NIO currency struct
NIO = Currency{code: "NIO", minorUnits: 2, factor: 100, name: "Cordoba Oro"}
// NOK currency struct
NOK = Currency{code: "NOK", minorUnits: 2, factor: 100, name: "Norwegian Krone"}
// NPR currency struct
NPR = Currency{code: "NPR", minorUnits: 2, factor: 100, name: "Nepalese Rupee"}
// NZD currency struct
NZD = Currency{code: "NZD", minorUnits: 2, factor: 100, name: "New Zealand Dollar"}
// OMR currency struct
OMR = Currency{code: "OMR", minorUnits: 3, factor: 1000, name: "Rial Omani"}
// PAB currency struct
PAB = Currency{code: "PAB", minorUnits: 2, factor: 100, name: "Balboa"}
// PEN currency struct
PEN = Currency{code: "PEN", minorUnits: 2, factor: 100, name: "Sol"}
// PGK currency struct
PGK = Currency{code: "PGK", minorUnits: 2, factor: 100, name: "Kina"}
// PHP currency struct
PHP = Currency{code: "PHP", minorUnits: 2, factor: 100, name: "Philippine Peso"}
// PKR currency struct
PKR = Currency{code: "PKR", minorUnits: 2, factor: 100, name: "Pakistan Rupee"}
// PLN currency struct
PLN = Currency{code: "PLN", minorUnits: 2, factor: 100, name: "Zloty"}
// PYG currency struct
PYG = Currency{code: "PYG", minorUnits: 0, factor: 1, name: "Guarani"}
// QAR currency struct
QAR = Currency{code: "QAR", minorUnits: 2, factor: 100, name: "Qatari Rial"}
// RON currency struct
RON = Currency{code: "RON", minorUnits: 2, factor: 100, name: "Romanian Leu"}
// RSD currency struct
RSD = Currency{code: "RSD", minorUnits: 2, factor: 100, name: "Serbian Dinar"}
// RUB currency struct
RUB = Currency{code: "RUB", minorUnits: 2, factor: 100, name: "Russian Ruble"}
// RWF currency struct
RWF = Currency{code: "RWF", minorUnits: 0, factor: 1, name: "Rwanda Franc"}
// SAR currency struct
SAR = Currency{code: "SAR", minorUnits: 2, factor: 100, name: "Saudi Riyal"}
// SBD currency struct
SBD = Currency{code: "SBD", minorUnits: 2, factor: 100, name: "Solomon Islands Dollar"}
// SCR currency struct
SCR = Currency{code: "SCR", minorUnits: 2, factor: 100, name: "Seychelles Rupee"}
// SDG currency struct
SDG = Currency{code: "SDG", minorUnits: 2, factor: 100, name: "Sudanese Pound"}
// SEK currency struct
SEK = Currency{code: "SEK", minorUnits: 2, factor: 100, name: "Swedish Krona"}
// SGD currency struct
SGD = Currency{code: "SGD", minorUnits: 2, factor: 100, name: "Singapore Dollar"}
// SHP currency struct
SHP = Currency{code: "SHP", minorUnits: 2, factor: 100, name: "Saint Helena Pound"}
// SLE currency struct
SLE = Currency{code: "SLE", minorUnits: 2, factor: 100, name: "Leone"}
// SOS currency struct
SOS = Currency{code: "SOS", minorUnits: 2, factor: 100, name: "Somali Shilling"}
// SRD currency struct
SRD = Currency{code: "SRD", minorUnits: 2, factor: 100, name: "Surinam Dollar"}
// SSP currency struct
SSP = Currency{code: "SSP", minorUnits: 2, factor: 100, name: "South Sudanese Pound"}
// STN currency struct
STN = Currency{code: "STN", minorUnits: 2, factor: 100, name: "Dobra"}
// SVC currency struct
SVC = Currency{code: "SVC", minorUnits: 2, factor: 100, name: "El Salvador Colon"}
// SYP currency struct
SYP = Currency{code: "SYP", minorUnits: 2, factor: 100, name: "Syrian Pound"}
// SZL currency struct
SZL = Currency{code: "SZL", minorUnits: 2, factor: 100, name: "Lilangeni"}
// THB currency struct
THB = Currency{code: "THB", minorUnits: 2, factor: 100, name: "Baht"}
// TJS currency struct
TJS = Currency{code: "TJS", minorUnits: 2, factor: 100, name: "Somoni"}
// TMT currency struct
TMT = Currency{code: "TMT", minorUnits: 2, factor: 100, name: "Turkmenistan New Manat"}
// TND currency struct
TND = Currency{code: "TND", minorUnits: 3, factor: 1000, name: "Tunisian Dinar"}
// TOP currency struct
TOP = Currency{code: "TOP", minorUnits: 2, factor: 100, name: "Pa’anga"}
// TRY currency struct
TRY = Currency{code: "TRY", minorUnits: 2, factor: 100, name: "Turkish Lira"}
// TTD currency struct
TTD = Currency{code: "TTD", minorUnits: 2, factor: 100, name: "Trinidad and Tobago Dollar"}
// TWD currency struct
TWD = Currency{code: "TWD", minorUnits: 2, factor: 100, name: "New Taiwan Dollar"}
// TZS currency struct
TZS = Currency{code: "TZS", minorUnits: 2, factor: 100, name: "Tanzanian Shilling"}
// UAH currency struct
UAH = Currency{code: "UAH", minorUnits: 2, factor: 100, name: "Hryvnia"}
// UGX currency struct
UGX = Currency{code: "UGX", minorUnits: 0, factor: 1, name: "Uganda Shilling"}
// USD currency struct
USD = Currency{code: "USD", minorUnits: 2, factor: 100, name: "US Dollar"}
// USN currency struct
USN = Currency{code: "USN", minorUnits: 2, factor: 100, name: "US Dollar (Next day)"}
// UYI currency struct
UYI = Currency{code: "UYI", minorUnits: 0, factor: 1, name: "Uruguay Peso en Unidades Indexadas (UI)"}
// UYU currency struct
UYU = Currency{code: "UYU", minorUnits: 2, factor: 100, name: "Peso Uruguayo"}
// UYW currency struct
UYW = Currency{code: "UYW", minorUnits: 4, factor: 10000, name: "Unidad Previsional"}
// UZS currency struct
UZS = Currency{code: "UZS", minorUnits: 2, factor: 100, name: "Uzbekistan Sum"}
// VED currency struct
VED = Currency{code: "VED", minorUnits: 2, factor: 100, name: "Bolívar Soberano"}
// VES currency struct
VES = Currency{code: "VES", minorUnits: 2, factor: 100, name: "Bolívar Soberano"}
// VND currency struct
VND = Currency{code: "VND", minorUnits: 0, factor: 1, name: "Dong"}
// VUV currency struct
VUV = Currency{code: "VUV", minorUnits: 0, factor: 1, name: "Vatu"}
// WST currency struct
WST = Currency{code: "WST", minorUnits: 2, factor: 100, name: "Tala"}
// XAF currency struct
XAF = Currency{code: "XAF", minorUnits: 0, factor: 1, name: "CFA Franc BEAC"}
// XAG currency struct
XAG = Currency{code: "XAG", minorUnits: 0, factor: 1, name: "Silver"}
// XAU currency struct
XAU = Currency{code: "XAU", minorUnits: 0, factor: 1, name: "Gold"}
// XBA currency struct
XBA = Currency{code: "XBA", minorUnits: 0, factor: 1, name: "Bond Markets Unit European Composite Unit (EURCO)"}
// XBB currency struct
XBB = Currency{code: "XBB", minorUnits: 0, factor: 1, name: "Bond Markets Unit European Monetary Unit (E.M.U.-6)"}
// XBC currency struct
XBC = Currency{code: "XBC", minorUnits: 0, factor: 1, name: "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)"}
// XBD currency struct
XBD = Currency{code: "XBD", minorUnits: 0, factor: 1, name: "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)"}
// XCD currency struct
XCD = Currency{code: "XCD", minorUnits: 2, factor: 100, name: "East Caribbean Dollar"}
// XDR currency struct
XDR = Currency{code: "XDR", minorUnits: 0, factor: 1, name: "SDR (Special Drawing Right)"}
// XOF currency struct
XOF = Currency{code: "XOF", minorUnits: 0, factor: 1, name: "CFA Franc BCEAO"}
// XPD currency struct
XPD = Currency{code: "XPD", minorUnits: 0, factor: 1, name: "Palladium"}
// XPF currency struct
XPF = Currency{code: "XPF", minorUnits: 0, factor: 1, name: "CFP Franc"}
// XPT currency struct
XPT = Currency{code: "XPT", minorUnits: 0, factor: 1, name: "Platinum"}
// XSU currency struct
XSU = Currency{code: "XSU", minorUnits: 0, factor: 1, name: "Sucre"}
// XTS currency struct
XTS = Currency{code: "XTS", minorUnits: 0, factor: 1, name: "Codes specifically reserved for testing purposes"}
// XUA currency struct
XUA = Currency{code: "XUA", minorUnits: 0, factor: 1, name: "ADB Unit of Account"}
// XXX currency struct
XXX = Currency{code: "XXX", minorUnits: 0, factor: 1, name: "The codes assigned for transactions where no currency is involved"}
// YER currency struct
YER = Currency{code: "YER", minorUnits: 2, factor: 100, name: "Yemeni Rial"}
// ZAR currency struct
ZAR = Currency{code: "ZAR", minorUnits: 2, factor: 100, name: "Rand"}
// ZMW currency struct
ZMW = Currency{code: "ZMW", minorUnits: 2, factor: 100, name: "Zambian Kwacha"}
// ZWG currency struct
ZWG = Currency{code: "ZWG", minorUnits: 2, factor: 100, name: "Zimbabwe Gold"}
)
var currencies = map[string]Currency{
"AED": AED,
"AFN": AFN,
"ALL": ALL,
"AMD": AMD,
"ANG": ANG,
"AOA": AOA,
"ARS": ARS,
"AUD": AUD,
"AWG": AWG,
"AZN": AZN,
"BAM": BAM,
"BBD": BBD,
"BDT": BDT,
"BGN": BGN,
"BHD": BHD,
"BIF": BIF,
"BMD": BMD,
"BND": BND,
"BOB": BOB,
"BOV": BOV,
"BRL": BRL,
"BSD": BSD,
"BTN": BTN,
"BWP": BWP,
"BYN": BYN,
"BZD": BZD,
"CAD": CAD,
"CDF": CDF,
"CHE": CHE,
"CHF": CHF,
"CHW": CHW,
"CLF": CLF,
"CLP": CLP,
"CNY": CNY,
"COP": COP,
"COU": COU,
"CRC": CRC,
"CUC": CUC,
"CUP": CUP,
"CVE": CVE,
"CZK": CZK,
"DJF": DJF,
"DKK": DKK,
"DOP": DOP,
"DZD": DZD,
"EGP": EGP,
"ERN": ERN,
"ETB": ETB,
"EUR": EUR,
"FJD": FJD,
"FKP": FKP,
"GBP": GBP,
"GEL": GEL,
"GHS": GHS,
"GIP": GIP,
"GMD": GMD,
"GNF": GNF,
"GTQ": GTQ,
"GYD": GYD,
"HKD": HKD,
"HNL": HNL,
"HTG": HTG,
"HUF": HUF,
"IDR": IDR,
"ILS": ILS,
"INR": INR,
"IQD": IQD,
"IRR": IRR,
"ISK": ISK,
"JMD": JMD,
"JOD": JOD,
"JPY": JPY,
"KES": KES,
"KGS": KGS,
"KHR": KHR,
"KMF": KMF,
"KPW": KPW,
"KRW": KRW,
"KWD": KWD,
"KYD": KYD,
"KZT": KZT,
"LAK": LAK,
"LBP": LBP,
"LKR": LKR,
"LRD": LRD,
"LSL": LSL,
"LYD": LYD,
"MAD": MAD,
"MDL": MDL,
"MGA": MGA,
"MKD": MKD,
"MMK": MMK,
"MNT": MNT,
"MOP": MOP,
"MRU": MRU,
"MUR": MUR,
"MVR": MVR,
"MWK": MWK,
"MXN": MXN,
"MXV": MXV,
"MYR": MYR,
"MZN": MZN,
"NAD": NAD,
"NGN": NGN,
"NIO": NIO,
"NOK": NOK,
"NPR": NPR,
"NZD": NZD,
"OMR": OMR,
"PAB": PAB,
"PEN": PEN,
"PGK": PGK,
"PHP": PHP,
"PKR": PKR,
"PLN": PLN,
"PYG": PYG,
"QAR": QAR,
"RON": RON,
"RSD": RSD,
"RUB": RUB,
"RWF": RWF,
"SAR": SAR,
"SBD": SBD,
"SCR": SCR,
"SDG": SDG,
"SEK": SEK,
"SGD": SGD,
"SHP": SHP,
"SLE": SLE,
"SOS": SOS,
"SRD": SRD,
"SSP": SSP,
"STN": STN,
"SVC": SVC,
"SYP": SYP,
"SZL": SZL,
"THB": THB,
"TJS": TJS,
"TMT": TMT,
"TND": TND,
"TOP": TOP,
"TRY": TRY,
"TTD": TTD,
"TWD": TWD,
"TZS": TZS,
"UAH": UAH,
"UGX": UGX,
"USD": USD,
"USN": USN,
"UYI": UYI,
"UYU": UYU,
"UYW": UYW,
"UZS": UZS,
"VED": VED,
"VES": VES,
"VND": VND,
"VUV": VUV,
"WST": WST,
"XAF": XAF,
"XAG": XAG,
"XAU": XAU,
"XBA": XBA,
"XBB": XBB,
"XBC": XBC,
"XBD": XBD,
"XCD": XCD,
"XDR": XDR,
"XOF": XOF,
"XPD": XPD,
"XPF": XPF,
"XPT": XPT,
"XSU": XSU,
"XTS": XTS,
"XUA": XUA,
"XXX": XXX,
"YER": YER,
"ZAR": ZAR,
"ZMW": ZMW,
"ZWG": ZWG,
}
// ValidCodes is provided so that you may build your own validation against it
var ValidCodes = []string{
"AED",
"AFN",
"ALL",
"AMD",
"ANG",
"AOA",
"ARS",
"AUD",
"AWG",
"AZN",
"BAM",
"BBD",
"BDT",
"BGN",
"BHD",
"BIF",
"BMD",
"BND",
"BOB",
"BOV",
"BRL",
"BSD",
"BTN",
"BWP",
"BYN",
"BZD",
"CAD",
"CDF",
"CHE",
"CHF",
"CHW",
"CLF",
"CLP",
"CNY",
"COP",
"COU",
"CRC",
"CUC",
"CUP",
"CVE",
"CZK",
"DJF",
"DKK",
"DOP",
"DZD",
"EGP",
"ERN",
"ETB",
"EUR",
"FJD",
"FKP",
"GBP",
"GEL",
"GHS",
"GIP",
"GMD",
"GNF",
"GTQ",
"GYD",
"HKD",
"HNL",
"HTG",
"HUF",
"IDR",
"ILS",
"INR",
"IQD",
"IRR",
"ISK",
"JMD",
"JOD",
"JPY",
"KES",
"KGS",
"KHR",
"KMF",
"KPW",
"KRW",
"KWD",
"KYD",
"KZT",
"LAK",
"LBP",
"LKR",
"LRD",
"LSL",
"LYD",
"MAD",
"MDL",
"MGA",
"MKD",
"MMK",
"MNT",
"MOP",
"MRU",
"MUR",
"MVR",
"MWK",
"MXN",
"MXV",
"MYR",
"MZN",
"NAD",
"NGN",
"NIO",
"NOK",
"NPR",
"NZD",
"OMR",
"PAB",
"PEN",
"PGK",
"PHP",
"PKR",
"PLN",
"PYG",
"QAR",
"RON",
"RSD",
"RUB",
"RWF",
"SAR",
"SBD",
"SCR",
"SDG",
"SEK",
"SGD",
"SHP",
"SLE",
"SOS",
"SRD",
"SSP",
"STN",
"SVC",
"SYP",
"SZL",
"THB",
"TJS",
"TMT",
"TND",
"TOP",
"TRY",
"TTD",
"TWD",
"TZS",
"UAH",
"UGX",
"USD",
"USN",
"UYI",
"UYU",
"UYW",
"UZS",
"VED",
"VES",
"VND",
"VUV",
"WST",
"XAF",
"XAG",
"XAU",
"XBA",
"XBB",
"XBC",
"XBD",
"XCD",
"XDR",
"XOF",
"XPD",
"XPF",
"XPT",
"XSU",
"XTS",
"XUA",
"XXX",
"YER",
"ZAR",
"ZMW",
"ZWG",
}