QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
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 ext::shared_ptr<Data> arsData(
36 new Data("Argentinian peso", "ARS", 32,
37 "", "", 100,
38 Rounding(),
39 "%2% %1$.2f"));
40 data_ = arsData;
41 }
42
43 // Brazilian real
44 /* The ISO three-letter code is BRL; the numeric code is 986.
45 It is divided in 100 centavos.
46 */
48 static ext::shared_ptr<Data> brlData(
49 new Data("Brazilian real", "BRL", 986,
50 "R$", "", 100,
51 Rounding(),
52 "%3% %1$.2f"));
53 data_ = brlData;
54 }
55
56 // Canadian dollar
57 /* The ISO three-letter code is CAD; the numeric code is 124.
58 It is divided into 100 cents.
59 */
61 static ext::shared_ptr<Data> cadData(
62 new Data("Canadian dollar", "CAD", 124,
63 "Can$", "", 100,
64 Rounding(),
65 "%3% %1$.2f"));
66 data_ = cadData;
67 }
68
69 // Chilean peso
70 /* The ISO three-letter code is CLP; the numeric code is 152.
71 It is divided in 100 centavos.
72 */
74 static ext::shared_ptr<Data> clpData(
75 new Data("Chilean peso", "CLP", 152,
76 "Ch$", "", 100,
77 Rounding(),
78 "%3% %1$.0f"));
79 data_ = clpData;
80 }
81
82 // Colombian peso
83 /* The ISO three-letter code is COP; the numeric code is 170.
84 It is divided in 100 centavos.
85 */
87 static ext::shared_ptr<Data> copData(
88 new Data("Colombian peso", "COP", 170,
89 "Col$", "", 100,
90 Rounding(),
91 "%3% %1$.2f"));
92 data_ = copData;
93 }
94
95 // Mexican peso
96 /* The ISO three-letter code is MXN; the numeric code is 484.
97 It is divided in 100 centavos.
98 */
100 static ext::shared_ptr<Data> mxnData(
101 new Data("Mexican peso", "MXN", 484,
102 "Mex$", "", 100,
103 Rounding(),
104 "%3% %1$.2f"));
105 data_ = mxnData;
106 }
107
108 // Peruvian nuevo sol
109 /* The ISO three-letter code is PEN; the numeric code is 604.
110 It is divided in 100 centimos.
111 */
113 static ext::shared_ptr<Data> penData(
114 new Data("Peruvian nuevo sol", "PEN", 604,
115 "S/.", "", 100,
116 Rounding(),
117 "%3% %1$.2f"));
118 data_ = penData;
119 }
120
121 // Peruvian inti
122 /* The ISO three-letter code was PEI.
123 It was divided in 100 centimos. A numeric code is not available;
124 as per ISO 3166-1, we assign 998 as a user-defined code.
125 */
127 static ext::shared_ptr<Data> peiData(
128 new Data("Peruvian inti", "PEI", 998,
129 "I/.", "", 100,
130 Rounding(),
131 "%3% %1$.2f"));
132 data_ = peiData;
133 }
134
135 // Peruvian sol
136 /* The ISO three-letter code was PEH. A numeric code is not available;
137 as per ISO 3166-1, we assign 999 as a user-defined code.
138 It was divided in 100 centavos.
139 */
141 static ext::shared_ptr<Data> pehData(
142 new Data("Peruvian sol", "PEH", 999,
143 "S./", "", 100,
144 Rounding(),
145 "%3% %1$.2f"));
146 data_ = pehData;
147 }
148
149 // Trinidad & Tobago dollar
150 /* The ISO three-letter code is TTD; the numeric code is 780.
151 It is divided in 100 cents.
152 */
154 static ext::shared_ptr<Data> ttdData(
155 new Data("Trinidad & Tobago dollar", "TTD", 780,
156 "TT$", "", 100,
157 Rounding(),
158 "%3% %1$.2f"));
159 data_ = ttdData;
160 }
161
162 // U.S. dollar
163 /* The ISO three-letter code is USD; the numeric code is 840.
164 It is divided in 100 cents.
165 */
167 static ext::shared_ptr<Data> usdData(
168 new Data("U.S. dollar", "USD", 840,
169 "$", "\xA2", 100,
170 Rounding(),
171 "%3% %1$.2f"));
172 data_ = usdData;
173 }
174
175 // Venezuelan bolivar
176 /* The ISO three-letter code is VEB; the numeric code is 862.
177 It is divided in 100 centimos.
178 */
180 static ext::shared_ptr<Data> vebData(
181 new Data("Venezuelan bolivar", "VEB", 862,
182 "Bs", "", 100,
183 Rounding(),
184 "%3% %1$.2f"));
185 data_ = vebData;
186 }
187
188 // Mexican Unidad de Inversion
190 static ext::shared_ptr<Data> mxvData(new Data("Mexican Unidad de Inversion", "MXV", 979,
191 "MXV", "", 1, Rounding(), "1$.2f %3%"));
192 data_ = mxvData;
193 }
194
195 // Unidad de Valor Real
197 static ext::shared_ptr<Data> couData(new Data("Unidad de Valor Real (UVR) (funds code)",
198 "COU", 970, "COU", "", 100, Rounding(),
199 "1$.2f %3%"));
200 data_ = couData;
201 }
202
203 // Unidad de Fomento
205 static ext::shared_ptr<Data> clfData(new Data(
206 "Unidad de Fomento (funds code)", "CLF", 990, "CLF", "", 1, Rounding(), "1$.2f %3%"));
207 data_ = clfData;
208 }
209
210 // Uruguayan peso
212 static ext::shared_ptr<Data> uyuData(
213 new Data("Uruguayan peso", "UYU", 858, "UYU", "", 1, Rounding(), "1$.2f %3%"));
214 data_ = uyuData;
215 }
216
217}
218
American currencies.
ext::shared_ptr< Data > data_
Definition: currency.hpp:108
basic rounding class
Definition: rounding.hpp:35
Definition: any.hpp:35