/src/quantlib/ql/currencies/europe.cpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2004, 2005, 2006 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 | | <https://www.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 | | |
26 | | #include <ql/currencies/europe.hpp> |
27 | | |
28 | | namespace QuantLib { |
29 | | |
30 | | // Bulgarian lev |
31 | | /* The ISO three-letter code is BGL; the numeric code is 100. |
32 | | It is divided in 100 stotinki. |
33 | | */ |
34 | 0 | BGLCurrency::BGLCurrency() { |
35 | 0 | static auto bglData = ext::make_shared<Data>("Bulgarian lev", "BGL", 100, "lv", "", 100, Rounding()); |
36 | 0 | data_ = bglData; |
37 | 0 | } |
38 | | |
39 | | // Belarussian ruble |
40 | | /* The ISO three-letter code is BYR; the numeric code is 974. |
41 | | It has no subdivisions. |
42 | | */ |
43 | 0 | BYRCurrency::BYRCurrency() { |
44 | 0 | static auto byrData = ext::make_shared<Data>("Belarussian ruble", "BYR", 974, "BR", "", 1, Rounding()); |
45 | 0 | data_ = byrData; |
46 | 0 | } |
47 | | |
48 | | // Swiss franc |
49 | | /* The ISO three-letter code is CHF; the numeric code is 756. |
50 | | It is divided into 100 cents. |
51 | | */ |
52 | 0 | CHFCurrency::CHFCurrency() { |
53 | 0 | static auto chfData = ext::make_shared<Data>("Swiss franc", "CHF", 756, "SwF", "", 100, Rounding()); |
54 | 0 | data_ = chfData; |
55 | 0 | } |
56 | | |
57 | | // Cyprus pound |
58 | | /* The ISO three-letter code is CYP; the numeric code is 196. |
59 | | It is divided in 100 cents. |
60 | | */ |
61 | 0 | CYPCurrency::CYPCurrency() { |
62 | 0 | static auto cypData = ext::make_shared<Data>("Cyprus pound", "CYP", 196, "\xA3" "C", "", 100, Rounding()); |
63 | 0 | data_ = cypData; |
64 | 0 | } |
65 | | |
66 | | // Czech koruna |
67 | | /* The ISO three-letter code is CZK; the numeric code is 203. |
68 | | It is divided in 100 haleru. |
69 | | */ |
70 | 0 | CZKCurrency::CZKCurrency() { |
71 | 0 | static auto czkData = ext::make_shared<Data>("Czech koruna", "CZK", 203, "Kc", "", 100, Rounding()); |
72 | 0 | data_ = czkData; |
73 | 0 | } |
74 | | |
75 | | // Danish krone |
76 | | /* The ISO three-letter code is DKK; the numeric code is 208. |
77 | | It is divided in 100 øre. |
78 | | */ |
79 | 0 | DKKCurrency::DKKCurrency() { |
80 | 0 | static auto dkkData = ext::make_shared<Data>("Danish krone", "DKK", 208, "Dkr", "", 100, Rounding()); |
81 | 0 | data_ = dkkData; |
82 | 0 | } |
83 | | |
84 | | // Estonian kroon |
85 | | /* The ISO three-letter code is EEK; the numeric code is 233. |
86 | | It is divided in 100 senti. |
87 | | */ |
88 | 0 | EEKCurrency::EEKCurrency() { |
89 | 0 | static auto eekData = ext::make_shared<Data>("Estonian kroon", "EEK", 233, "KR", "", 100, Rounding()); |
90 | 0 | data_ = eekData; |
91 | 0 | } |
92 | | |
93 | | // European Euro |
94 | | /* The ISO three-letter code is EUR; the numeric code is 978. |
95 | | It is divided into 100 cents. |
96 | | */ |
97 | 0 | EURCurrency::EURCurrency() { |
98 | 0 | static auto eurData = ext::make_shared<Data>("European Euro", "EUR", 978, "", "", 100, ClosestRounding(2)); |
99 | 0 | data_ = eurData; |
100 | 0 | } |
101 | | |
102 | | // British pound sterling |
103 | | /* The ISO three-letter code is GBP; the numeric code is 826. |
104 | | It is divided into 100 pence. |
105 | | */ |
106 | 0 | GBPCurrency::GBPCurrency() { |
107 | 0 | static auto gbpData = ext::make_shared<Data>("British pound sterling", "GBP", 826, "\xA3", "p", 100, Rounding()); |
108 | 0 | data_ = gbpData; |
109 | 0 | } |
110 | | |
111 | | // Hungarian forint |
112 | | /* The ISO three-letter code is HUF; the numeric code is 348. |
113 | | It has no subdivisions. |
114 | | */ |
115 | 0 | HUFCurrency::HUFCurrency() { |
116 | 0 | static auto hufData = ext::make_shared<Data>("Hungarian forint", "HUF", 348, "Ft", "", 1, Rounding()); |
117 | 0 | data_ = hufData; |
118 | 0 | } |
119 | | |
120 | | // Icelandic krona |
121 | | /* The ISO three-letter code is ISK; the numeric code is 352. |
122 | | It is divided in 100 aurar. |
123 | | */ |
124 | 0 | ISKCurrency::ISKCurrency() { |
125 | 0 | static auto iskData = ext::make_shared<Data>("Iceland krona", "ISK", 352, "IKr", "", 100, Rounding()); |
126 | 0 | data_ = iskData; |
127 | 0 | } |
128 | | |
129 | | // Lithuanian litas |
130 | | /* The ISO three-letter code is LTL; the numeric code is 440. |
131 | | It is divided in 100 centu. |
132 | | */ |
133 | 0 | LTLCurrency::LTLCurrency() { |
134 | 0 | static auto ltlData = ext::make_shared<Data>("Lithuanian litas", "LTL", 440, "Lt", "", 100, Rounding()); |
135 | 0 | data_ = ltlData; |
136 | 0 | } |
137 | | |
138 | | // Latvian lat |
139 | | /* The ISO three-letter code is LVL; the numeric code is 428. |
140 | | It is divided in 100 santims. |
141 | | */ |
142 | 0 | LVLCurrency::LVLCurrency() { |
143 | 0 | static auto lvlData = ext::make_shared<Data>("Latvian lat", "LVL", 428, "Ls", "", 100, Rounding()); |
144 | 0 | data_ = lvlData; |
145 | 0 | } |
146 | | |
147 | | // Norwegian krone |
148 | | /* The ISO three-letter code is NOK; the numeric code is 578. |
149 | | It is divided in 100 øre. |
150 | | */ |
151 | 0 | NOKCurrency::NOKCurrency() { |
152 | 0 | static auto nokData = ext::make_shared<Data>("Norwegian krone", "NOK", 578, "NKr", "", 100, Rounding()); |
153 | 0 | data_ = nokData; |
154 | 0 | } |
155 | | |
156 | | // Polish zloty |
157 | | /* The ISO three-letter code is PLN; the numeric code is 985. |
158 | | It is divided in 100 groszy. |
159 | | */ |
160 | 0 | PLNCurrency::PLNCurrency() { |
161 | 0 | static auto plnData = ext::make_shared<Data>("Polish zloty", "PLN", 985, "zl", "", 100, Rounding()); |
162 | 0 | data_ = plnData; |
163 | 0 | } |
164 | | |
165 | | // Romanian leu |
166 | | /* The ISO three-letter code was ROL; the numeric code was 642. |
167 | | It was divided in 100 bani. |
168 | | */ |
169 | 0 | ROLCurrency::ROLCurrency() { |
170 | 0 | static auto rolData = ext::make_shared<Data>("Romanian leu", "ROL", 642, "L", "", 100, Rounding()); |
171 | 0 | data_ = rolData; |
172 | 0 | } |
173 | | |
174 | | // Romanian new leu |
175 | | /* The ISO three-letter code is RON; the numeric code is 946. |
176 | | It is divided in 100 bani. |
177 | | */ |
178 | 0 | RONCurrency::RONCurrency() { |
179 | 0 | static auto ronData = ext::make_shared<Data>("Romanian new leu", "RON", 946, "L", "", 100, Rounding()); |
180 | 0 | data_ = ronData; |
181 | 0 | } |
182 | | |
183 | | // Russian ruble |
184 | | /* The ISO three-letter code is RUB; the numeric code is 643. |
185 | | It is divided in 100 kopeyki. |
186 | | */ |
187 | 0 | RUBCurrency::RUBCurrency() { |
188 | 0 | static auto rubData = ext::make_shared<Data>("Russian ruble", "RUB", 643, "", "", 100, Rounding()); |
189 | 0 | data_ = rubData; |
190 | 0 | } |
191 | | |
192 | | // Swedish krona |
193 | | /* The ISO three-letter code is SEK; the numeric code is 752. |
194 | | It is divided in 100 öre. |
195 | | */ |
196 | 0 | SEKCurrency::SEKCurrency() { |
197 | 0 | static auto sekData = ext::make_shared<Data>("Swedish krona", "SEK", 752, "kr", "", 100, Rounding()); |
198 | 0 | data_ = sekData; |
199 | 0 | } |
200 | | |
201 | | // Slovenian tolar |
202 | | /* The ISO three-letter code is SIT; the numeric code is 705. |
203 | | It is divided in 100 stotinov. |
204 | | */ |
205 | 0 | SITCurrency::SITCurrency() { |
206 | 0 | static auto sitData = ext::make_shared<Data>("Slovenian tolar", "SIT", 705, "SlT", "", 100, Rounding()); |
207 | 0 | data_ = sitData; |
208 | 0 | } |
209 | | |
210 | | // Turkish lira |
211 | | /* The ISO three-letter code was TRL; the numeric code was 792. |
212 | | It was divided in 100 kurus. |
213 | | */ |
214 | 0 | TRLCurrency::TRLCurrency() { |
215 | 0 | static auto trlData = ext::make_shared<Data>("Turkish lira", "TRL", 792, "TL", "", 100, Rounding()); |
216 | 0 | data_ = trlData; |
217 | 0 | } |
218 | | |
219 | | // New Turkish lira |
220 | | /* The ISO three-letter code is TRY; the numeric code is 949. |
221 | | It is divided in 100 new kurus. |
222 | | */ |
223 | 0 | TRYCurrency::TRYCurrency() { |
224 | 0 | static auto tryData = ext::make_shared<Data>("New Turkish lira", "TRY", 949, "YTL", "", 100, Rounding()); |
225 | 0 | data_ = tryData; |
226 | 0 | } |
227 | | |
228 | | |
229 | | // currencies obsoleted by Euro |
230 | | |
231 | | // Austrian shilling |
232 | | /* The ISO three-letter code was ATS; the numeric code was 40. |
233 | | It was divided in 100 groschen. |
234 | | */ |
235 | 0 | ATSCurrency::ATSCurrency() { |
236 | 0 | static auto atsData = ext::make_shared<Data>("Austrian shilling", "ATS", 40, "", "", 100, Rounding(), EURCurrency()); |
237 | 0 | data_ = atsData; |
238 | 0 | } |
239 | | |
240 | | // Belgian franc |
241 | | /* The ISO three-letter code was BEF; the numeric code was 56. |
242 | | It had no subdivisions. |
243 | | */ |
244 | 0 | BEFCurrency::BEFCurrency() { |
245 | 0 | static auto befData = ext::make_shared<Data>("Belgian franc", "BEF", 56, "", "", 1, Rounding(), EURCurrency()); |
246 | 0 | data_ = befData; |
247 | 0 | } |
248 | | |
249 | | // Deutsche mark |
250 | | /* The ISO three-letter code was DEM; the numeric code was 276. |
251 | | It was divided into 100 pfennig. |
252 | | */ |
253 | 0 | DEMCurrency::DEMCurrency() { |
254 | 0 | static auto demData = ext::make_shared<Data>("Deutsche mark", "DEM", 276, "DM", "", 100, Rounding(), EURCurrency()); |
255 | 0 | data_ = demData; |
256 | 0 | } |
257 | | |
258 | | // Spanish peseta |
259 | | /* The ISO three-letter code was ESP; the numeric code was 724. |
260 | | It was divided in 100 centimos. |
261 | | */ |
262 | 0 | ESPCurrency::ESPCurrency() { |
263 | 0 | static auto espData = ext::make_shared<Data>("Spanish peseta", "ESP", 724, "Pta", "", 100, Rounding(), EURCurrency()); |
264 | 0 | data_ = espData; |
265 | 0 | } |
266 | | |
267 | | // Finnish markka |
268 | | /* The ISO three-letter code was FIM; the numeric code was 246. |
269 | | It was divided in 100 penniä. |
270 | | */ |
271 | 0 | FIMCurrency::FIMCurrency() { |
272 | 0 | static auto fimData = ext::make_shared<Data>("Finnish markka", "FIM", 246, "mk", "", 100, Rounding(), EURCurrency()); |
273 | 0 | data_ = fimData; |
274 | 0 | } |
275 | | |
276 | | // French franc |
277 | | /* The ISO three-letter code was FRF; the numeric code was 250. |
278 | | It was divided in 100 centimes. |
279 | | */ |
280 | 0 | FRFCurrency::FRFCurrency() { |
281 | 0 | static auto frfData = ext::make_shared<Data>("French franc", "FRF", 250, "", "", 100, Rounding(), EURCurrency()); |
282 | 0 | data_ = frfData; |
283 | 0 | } |
284 | | |
285 | | // Greek drachma |
286 | | /* The ISO three-letter code was GRD; the numeric code was 300. |
287 | | It was divided in 100 lepta. |
288 | | */ |
289 | 0 | GRDCurrency::GRDCurrency() { |
290 | 0 | static auto grdData = ext::make_shared<Data>("Greek drachma", "GRD", 300, "", "", 100, Rounding(), EURCurrency()); |
291 | 0 | data_ = grdData; |
292 | 0 | } |
293 | | |
294 | | // Irish punt |
295 | | /* The ISO three-letter code was IEP; the numeric code was 372. |
296 | | It was divided in 100 pence. |
297 | | */ |
298 | 0 | IEPCurrency::IEPCurrency() { |
299 | 0 | static auto iepData = ext::make_shared<Data>("Irish punt", "IEP", 372, "", "", 100, Rounding(), EURCurrency()); |
300 | 0 | data_ = iepData; |
301 | 0 | } |
302 | | |
303 | | // Italian lira |
304 | | /* The ISO three-letter code was ITL; the numeric code was 380. |
305 | | It had no subdivisions. |
306 | | */ |
307 | 0 | ITLCurrency::ITLCurrency() { |
308 | 0 | static auto itlData = ext::make_shared<Data>("Italian lira", "ITL", 380, "L", "", 1, Rounding(), EURCurrency()); |
309 | 0 | data_ = itlData; |
310 | 0 | } |
311 | | |
312 | | // Luxembourg franc |
313 | | /* The ISO three-letter code was LUF; the numeric code was 442. |
314 | | It was divided in 100 centimes. |
315 | | */ |
316 | 0 | LUFCurrency::LUFCurrency() { |
317 | 0 | static auto lufData = ext::make_shared<Data>("Luxembourg franc", "LUF", 442, "F", "", 100, Rounding(), EURCurrency()); |
318 | 0 | data_ = lufData; |
319 | 0 | } |
320 | | |
321 | | // Maltese lira |
322 | | /* The ISO three-letter code is MTL; the numeric code is 470. |
323 | | It is divided in 100 cents. |
324 | | */ |
325 | 0 | MTLCurrency::MTLCurrency() { |
326 | 0 | static auto mtlData = ext::make_shared<Data>("Maltese lira", "MTL", 470, "Lm", "", 100, Rounding()); |
327 | 0 | data_ = mtlData; |
328 | 0 | } |
329 | | |
330 | | // Dutch guilder |
331 | | /* The ISO three-letter code was NLG; the numeric code was 528. |
332 | | It was divided in 100 cents. |
333 | | */ |
334 | 0 | NLGCurrency::NLGCurrency() { |
335 | 0 | static auto nlgData = ext::make_shared<Data>("Dutch guilder", "NLG", 528, "f", "", 100, Rounding(), EURCurrency()); |
336 | 0 | data_ = nlgData; |
337 | 0 | } |
338 | | |
339 | | // Portuguese escudo |
340 | | /* The ISO three-letter code was PTE; the numeric code was 620. |
341 | | It was divided in 100 centavos. |
342 | | */ |
343 | 0 | PTECurrency::PTECurrency() { |
344 | 0 | static auto pteData = ext::make_shared<Data>("Portuguese escudo", "PTE", 620, "Esc", "", 100, Rounding(), EURCurrency()); |
345 | 0 | data_ = pteData; |
346 | 0 | } |
347 | | |
348 | | // Slovak koruna |
349 | | /* The ISO three-letter code is SKK; the numeric code is 703. |
350 | | It is divided in 100 halierov. |
351 | | */ |
352 | 0 | SKKCurrency::SKKCurrency() { |
353 | 0 | static auto skkData = ext::make_shared<Data>("Slovak koruna", "SKK", 703, "Sk", "", 100, Rounding()); |
354 | 0 | data_ = skkData; |
355 | 0 | } |
356 | | |
357 | | // Ukrainian hryvnia |
358 | | /* The ISO three-letter code is UAH; the numeric code is 980. |
359 | | It is divided in 100 kopiykas. |
360 | | */ |
361 | 0 | UAHCurrency::UAHCurrency() { |
362 | 0 | static auto uahData = ext::make_shared<Data>("Ukrainian hryvnia", "UAH", 980, "hrn", "", 100, Rounding()); |
363 | 0 | data_ = uahData; |
364 | 0 | } |
365 | | |
366 | | // Serbian dinar |
367 | 0 | RSDCurrency::RSDCurrency() { |
368 | 0 | static auto rsdData = ext::make_shared<Data>("Serbian dinar", "RSD", 941, "RSD", "", 100, Rounding()); |
369 | 0 | data_ = rsdData; |
370 | 0 | } |
371 | | |
372 | | // Croatian kuna |
373 | 0 | HRKCurrency::HRKCurrency() { |
374 | 0 | static auto hrkData = ext::make_shared<Data>("Croatian kuna", "HRK", 191, "HRK", "", 100, Rounding()); |
375 | 0 | data_ = hrkData; |
376 | 0 | } |
377 | | |
378 | | // Bulgarian lev |
379 | 0 | BGNCurrency::BGNCurrency() { |
380 | 0 | static auto bgnData = ext::make_shared<Data>("Bulgarian lev", "BGN", 975, "BGN", "", 100, Rounding()); |
381 | 0 | data_ = bgnData; |
382 | 0 | } |
383 | | |
384 | | // Georgian lari |
385 | 0 | GELCurrency::GELCurrency() { |
386 | 0 | static auto gelData = ext::make_shared<Data>("Georgian lari", "GEL", 981, "GEL", "", 100, Rounding()); |
387 | 0 | data_ = gelData; |
388 | 0 | } |
389 | | |
390 | | } |
391 | | |