QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
america.cpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2004, 2005, 2008 StatPro Italia srl
5 Copyright (C) 2016 Quaternion Risk Management Ltd
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*
22 Data from http://fx.sauder.ubc.ca/currency_table.html
23 and http://www.thefinancials.com/vortex/CurrencyFormats.html
24*/
25
27
28namespace QuantLib {
29
30 // Argentinian peso
31 /* The ISO three-letter code is ARS; the numeric code is 32.
32 It is divided in 100 centavos.
33 */
35 static auto arsData = ext::make_shared<Data>("Argentinian peso", "ARS", 32, "", "", 100, Rounding());
36 data_ = arsData;
37 }
38
39 // Brazilian real
40 /* The ISO three-letter code is BRL; the numeric code is 986.
41 It is divided in 100 centavos.
42 */
44 static auto brlData = ext::make_shared<Data>("Brazilian real", "BRL", 986, "R$", "", 100, Rounding());
45 data_ = brlData;
46 }
47
48 // Canadian dollar
49 /* The ISO three-letter code is CAD; the numeric code is 124.
50 It is divided into 100 cents.
51 */
53 static auto cadData = ext::make_shared<Data>("Canadian dollar", "CAD", 124, "Can$", "", 100, Rounding());
54 data_ = cadData;
55 }
56
57 // Chilean peso
58 /* The ISO three-letter code is CLP; the numeric code is 152.
59 It is divided in 100 centavos.
60 */
62 static auto clpData = ext::make_shared<Data>("Chilean peso", "CLP", 152, "Ch$", "", 100, Rounding());
63 data_ = clpData;
64 }
65
66 // Colombian peso
67 /* The ISO three-letter code is COP; the numeric code is 170.
68 It is divided in 100 centavos.
69 */
71 static auto copData = ext::make_shared<Data>("Colombian peso", "COP", 170, "Col$", "", 100, Rounding());
72 data_ = copData;
73 }
74
75 // Mexican peso
76 /* The ISO three-letter code is MXN; the numeric code is 484.
77 It is divided in 100 centavos.
78 */
80 static auto mxnData = ext::make_shared<Data>("Mexican peso", "MXN", 484, "Mex$", "", 100, Rounding());
81 data_ = mxnData;
82 }
83
84 // Peruvian nuevo sol
85 /* The ISO three-letter code is PEN; the numeric code is 604.
86 It is divided in 100 centimos.
87 */
89 static auto penData = ext::make_shared<Data>("Peruvian nuevo sol", "PEN", 604, "S/.", "", 100, Rounding());
90 data_ = penData;
91 }
92
93 // Peruvian inti
94 /* The ISO three-letter code was PEI.
95 It was divided in 100 centimos. A numeric code is not available;
96 as per ISO 3166-1, we assign 998 as a user-defined code.
97 */
99 static auto peiData = ext::make_shared<Data>("Peruvian inti", "PEI", 998, "I/.", "", 100, Rounding());
100 data_ = peiData;
101 }
102
103 // Peruvian sol
104 /* The ISO three-letter code was PEH. A numeric code is not available;
105 as per ISO 3166-1, we assign 999 as a user-defined code.
106 It was divided in 100 centavos.
107 */
109 static auto pehData = ext::make_shared<Data>("Peruvian sol", "PEH", 999, "S./", "", 100, Rounding());
110 data_ = pehData;
111 }
112
113 // Trinidad & Tobago dollar
114 /* The ISO three-letter code is TTD; the numeric code is 780.
115 It is divided in 100 cents.
116 */
118 static auto ttdData = ext::make_shared<Data>("Trinidad & Tobago dollar", "TTD", 780, "TT$", "", 100, Rounding());
119 data_ = ttdData;
120 }
121
122 // U.S. dollar
123 /* The ISO three-letter code is USD; the numeric code is 840.
124 It is divided in 100 cents.
125 */
127 static auto usdData = ext::make_shared<Data>("U.S. dollar", "USD", 840, "$", "\xA2", 100, Rounding());
128 data_ = usdData;
129 }
130
131 // Venezuelan bolivar
132 /* The ISO three-letter code is VEB; the numeric code is 862.
133 It is divided in 100 centimos.
134 */
136 static auto vebData = ext::make_shared<Data>("Venezuelan bolivar", "VEB", 862, "Bs", "", 100, Rounding());
137 data_ = vebData;
138 }
139
140 // Mexican Unidad de Inversion
142 static auto mxvData = ext::make_shared<Data>("Mexican Unidad de Inversion", "MXV", 979, "MXV", "", 1, Rounding());
143 data_ = mxvData;
144 }
145
146 // Unidad de Valor Real
148 static auto couData = ext::make_shared<Data>("Unidad de Valor Real (UVR) (funds code)", "COU", 970, "COU", "", 100, Rounding());
149 data_ = couData;
150 }
151
152 // Unidad de Fomento
154 static auto clfData = ext::make_shared<Data>("Unidad de Fomento (funds code)", "CLF", 990, "CLF", "", 1, Rounding());
155 data_ = clfData;
156 }
157
158 // Uruguayan peso
160 static auto uyuData = ext::make_shared<Data>("Uruguayan peso", "UYU", 858, "UYU", "", 1, Rounding());
161 data_ = uyuData;
162 }
163
164}
165
American currencies.
ext::shared_ptr< Data > data_
Definition: currency.hpp:85
basic rounding class
Definition: rounding.hpp:35
Definition: any.hpp:37