QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
europe.cpp
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 <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
26#include <ql/currencies/europe.hpp>
27
28namespace 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 */
35 static ext::shared_ptr<Data> bglData(
36 new Data("Bulgarian lev", "BGL", 100,
37 "lv", "", 100,
38 Rounding(),
39 "%1$.2f %3%"));
40 data_ = bglData;
41 }
42
43 // Belarussian ruble
44 /* The ISO three-letter code is BYR; the numeric code is 974.
45 It has no subdivisions.
46 */
48 static ext::shared_ptr<Data> byrData(
49 new Data("Belarussian ruble", "BYR", 974,
50 "BR", "", 1,
51 Rounding(),
52 "%2% %1$.0f"));
53 data_ = byrData;
54 }
55
56 // Swiss franc
57 /* The ISO three-letter code is CHF; the numeric code is 756.
58 It is divided into 100 cents.
59 */
61 static ext::shared_ptr<Data> chfData(
62 new Data("Swiss franc", "CHF", 756,
63 "SwF", "", 100,
64 Rounding(),
65 "%3% %1$.2f"));
66 data_ = chfData;
67 }
68
69 // Cyprus pound
70 /* The ISO three-letter code is CYP; the numeric code is 196.
71 It is divided in 100 cents.
72 */
74 static ext::shared_ptr<Data> cypData(
75 new Data("Cyprus pound", "CYP", 196,
76 "\xA3" "C", "", 100,
77 Rounding(),
78 "%3% %1$.2f"));
79 data_ = cypData;
80 }
81
82 // Czech koruna
83 /* The ISO three-letter code is CZK; the numeric code is 203.
84 It is divided in 100 haleru.
85 */
87 static ext::shared_ptr<Data> czkData(
88 new Data("Czech koruna", "CZK", 203,
89 "Kc", "", 100,
90 Rounding(),
91 "%1$.2f %3%"));
92 data_ = czkData;
93 }
94
95 // Danish krone
96 /* The ISO three-letter code is DKK; the numeric code is 208.
97 It is divided in 100 øre.
98 */
100 static ext::shared_ptr<Data> dkkData(
101 new Data("Danish krone", "DKK", 208,
102 "Dkr", "", 100,
103 Rounding(),
104 "%3% %1$.2f"));
105 data_ = dkkData;
106 }
107
108 // Estonian kroon
109 /* The ISO three-letter code is EEK; the numeric code is 233.
110 It is divided in 100 senti.
111 */
113 static ext::shared_ptr<Data> eekData(
114 new Data("Estonian kroon", "EEK", 233,
115 "KR", "", 100,
116 Rounding(),
117 "%1$.2f %2%"));
118 data_ = eekData;
119 }
120
121 // European Euro
122 /* The ISO three-letter code is EUR; the numeric code is 978.
123 It is divided into 100 cents.
124 */
126 static ext::shared_ptr<Data> eurData(
127 new Data("European Euro", "EUR", 978,
128 "", "", 100,
130 "%2% %1$.2f"));
131 data_ = eurData;
132 }
133
134 // British pound sterling
135 /* The ISO three-letter code is GBP; the numeric code is 826.
136 It is divided into 100 pence.
137 */
139 static ext::shared_ptr<Data> gbpData(
140 new Data("British pound sterling", "GBP", 826,
141 "\xA3", "p", 100,
142 Rounding(),
143 "%3% %1$.2f"));
144 data_ = gbpData;
145 }
146
147 // Hungarian forint
148 /* The ISO three-letter code is HUF; the numeric code is 348.
149 It has no subdivisions.
150 */
152 static ext::shared_ptr<Data> hufData(
153 new Data("Hungarian forint", "HUF", 348,
154 "Ft", "", 1,
155 Rounding(),
156 "%1$.0f %3%"));
157 data_ = hufData;
158 }
159
160 // Icelandic krona
161 /* The ISO three-letter code is ISK; the numeric code is 352.
162 It is divided in 100 aurar.
163 */
165 static ext::shared_ptr<Data> iskData(
166 new Data("Iceland krona", "ISK", 352,
167 "IKr", "", 100,
168 Rounding(),
169 "%1$.2f %3%"));
170 data_ = iskData;
171 }
172
173 // Lithuanian litas
174 /* The ISO three-letter code is LTL; the numeric code is 440.
175 It is divided in 100 centu.
176 */
178 static ext::shared_ptr<Data> ltlData(
179 new Data("Lithuanian litas", "LTL", 440,
180 "Lt", "", 100,
181 Rounding(),
182 "%1$.2f %3%"));
183 data_ = ltlData;
184 }
185
186 // Latvian lat
187 /* The ISO three-letter code is LVL; the numeric code is 428.
188 It is divided in 100 santims.
189 */
191 static ext::shared_ptr<Data> lvlData(
192 new Data("Latvian lat", "LVL", 428,
193 "Ls", "", 100,
194 Rounding(),
195 "%3% %1$.2f"));
196 data_ = lvlData;
197 }
198
199 // Norwegian krone
200 /* The ISO three-letter code is NOK; the numeric code is 578.
201 It is divided in 100 øre.
202 */
204 static ext::shared_ptr<Data> nokData(
205 new Data("Norwegian krone", "NOK", 578,
206 "NKr", "", 100,
207 Rounding(),
208 "%3% %1$.2f"));
209 data_ = nokData;
210 }
211
212 // Polish zloty
213 /* The ISO three-letter code is PLN; the numeric code is 985.
214 It is divided in 100 groszy.
215 */
217 static ext::shared_ptr<Data> plnData(
218 new Data("Polish zloty", "PLN", 985,
219 "zl", "", 100,
220 Rounding(),
221 "%1$.2f %3%"));
222 data_ = plnData;
223 }
224
225 // Romanian leu
226 /* The ISO three-letter code was ROL; the numeric code was 642.
227 It was divided in 100 bani.
228 */
230 static ext::shared_ptr<Data> rolData(
231 new Data("Romanian leu", "ROL", 642,
232 "L", "", 100,
233 Rounding(),
234 "%1$.2f %3%"));
235 data_ = rolData;
236 }
237
238 // Romanian new leu
239 /* The ISO three-letter code is RON; the numeric code is 946.
240 It is divided in 100 bani.
241 */
243 static ext::shared_ptr<Data> ronData(
244 new Data("Romanian new leu",
245 "RON", 946,
246 "L", "", 100,
247 Rounding(),
248 "%1$.2f %3%"));
249 data_ = ronData;
250 }
251
252 // Russian ruble
253 /* The ISO three-letter code is RUB; the numeric code is 643.
254 It is divided in 100 kopeyki.
255 */
257 static ext::shared_ptr<Data> rubData(
258 new Data("Russian ruble",
259 "RUB", 643,
260 "", "", 100,
261 Rounding(),
262 "%1$.2f %2%"));
263 data_ = rubData;
264 }
265
266 // Swedish krona
267 /* The ISO three-letter code is SEK; the numeric code is 752.
268 It is divided in 100 öre.
269 */
271 static ext::shared_ptr<Data> sekData(
272 new Data("Swedish krona", "SEK", 752,
273 "kr", "", 100,
274 Rounding(),
275 "%1$.2f %3%"));
276 data_ = sekData;
277 }
278
279 // Slovenian tolar
280 /* The ISO three-letter code is SIT; the numeric code is 705.
281 It is divided in 100 stotinov.
282 */
284 static ext::shared_ptr<Data> sitData(
285 new Data("Slovenian tolar", "SIT", 705,
286 "SlT", "", 100,
287 Rounding(),
288 "%1$.2f %3%"));
289 data_ = sitData;
290 }
291
292 // Turkish lira
293 /* The ISO three-letter code was TRL; the numeric code was 792.
294 It was divided in 100 kurus.
295 */
297 static ext::shared_ptr<Data> trlData(
298 new Data("Turkish lira", "TRL", 792,
299 "TL", "", 100,
300 Rounding(),
301 "%1$.0f %3%"));
302 data_ = trlData;
303 }
304
305 // New Turkish lira
306 /* The ISO three-letter code is TRY; the numeric code is 949.
307 It is divided in 100 new kurus.
308 */
310 static ext::shared_ptr<Data> tryData(
311 new Data("New Turkish lira", "TRY", 949,
312 "YTL", "", 100,
313 Rounding(),
314 "%1$.2f %3%"));
315 data_ = tryData;
316 }
317
318
319 // currencies obsoleted by Euro
320
321 // Austrian shilling
322 /* The ISO three-letter code was ATS; the numeric code was 40.
323 It was divided in 100 groschen.
324 */
326 static ext::shared_ptr<Data> atsData(
327 new Data("Austrian shilling", "ATS", 40,
328 "", "", 100,
329 Rounding(),
330 "%2% %1$.2f",
331 EURCurrency()));
332 data_ = atsData;
333 }
334
335 // Belgian franc
336 /* The ISO three-letter code was BEF; the numeric code was 56.
337 It had no subdivisions.
338 */
340 static ext::shared_ptr<Data> befData(
341 new Data("Belgian franc", "BEF", 56,
342 "", "", 1,
343 Rounding(),
344 "%2% %1$.0f",
345 EURCurrency()));
346 data_ = befData;
347 }
348
349 // Deutsche mark
350 /* The ISO three-letter code was DEM; the numeric code was 276.
351 It was divided into 100 pfennig.
352 */
354 static ext::shared_ptr<Data> demData(
355 new Data("Deutsche mark", "DEM", 276,
356 "DM", "", 100,
357 Rounding(),
358 "%1$.2f %3%",
359 EURCurrency()));
360 data_ = demData;
361 }
362
363 // Spanish peseta
364 /* The ISO three-letter code was ESP; the numeric code was 724.
365 It was divided in 100 centimos.
366 */
368 static ext::shared_ptr<Data> espData(
369 new Data("Spanish peseta", "ESP", 724,
370 "Pta", "", 100,
371 Rounding(),
372 "%1$.0f %3%",
373 EURCurrency()));
374 data_ = espData;
375 }
376
377 // Finnish markka
378 /* The ISO three-letter code was FIM; the numeric code was 246.
379 It was divided in 100 penniä.
380 */
382 static ext::shared_ptr<Data> fimData(
383 new Data("Finnish markka", "FIM", 246,
384 "mk", "", 100,
385 Rounding(),
386 "%1$.2f %3%",
387 EURCurrency()));
388 data_ = fimData;
389 }
390
391 // French franc
392 /* The ISO three-letter code was FRF; the numeric code was 250.
393 It was divided in 100 centimes.
394 */
396 static ext::shared_ptr<Data> frfData(
397 new Data("French franc", "FRF", 250,
398 "", "", 100,
399 Rounding(),
400 "%1$.2f %2%",
401 EURCurrency()));
402 data_ = frfData;
403 }
404
405 // Greek drachma
406 /* The ISO three-letter code was GRD; the numeric code was 300.
407 It was divided in 100 lepta.
408 */
410 static ext::shared_ptr<Data> grdData(
411 new Data("Greek drachma", "GRD", 300,
412 "", "", 100,
413 Rounding(),
414 "%1$.2f %2%",
415 EURCurrency()));
416 data_ = grdData;
417 }
418
419 // Irish punt
420 /* The ISO three-letter code was IEP; the numeric code was 372.
421 It was divided in 100 pence.
422 */
424 static ext::shared_ptr<Data> iepData(
425 new Data("Irish punt", "IEP", 372,
426 "", "", 100,
427 Rounding(),
428 "%2% %1$.2f",
429 EURCurrency()));
430 data_ = iepData;
431 }
432
433 // Italian lira
434 /* The ISO three-letter code was ITL; the numeric code was 380.
435 It had no subdivisions.
436 */
438 static ext::shared_ptr<Data> itlData(
439 new Data("Italian lira", "ITL", 380,
440 "L", "", 1,
441 Rounding(),
442 "%3% %1$.0f",
443 EURCurrency()));
444 data_ = itlData;
445 }
446
447 // Luxembourg franc
448 /* The ISO three-letter code was LUF; the numeric code was 442.
449 It was divided in 100 centimes.
450 */
452 static ext::shared_ptr<Data> lufData(
453 new Data("Luxembourg franc", "LUF", 442,
454 "F", "", 100,
455 Rounding(),
456 "%1$.0f %3%",
457 EURCurrency()));
458 data_ = lufData;
459 }
460
461 // Maltese lira
462 /* The ISO three-letter code is MTL; the numeric code is 470.
463 It is divided in 100 cents.
464 */
466 static ext::shared_ptr<Data> mtlData(
467 new Data("Maltese lira", "MTL", 470,
468 "Lm", "", 100,
469 Rounding(),
470 "%3% %1$.2f"));
471 data_ = mtlData;
472 }
473
474 // Dutch guilder
475 /* The ISO three-letter code was NLG; the numeric code was 528.
476 It was divided in 100 cents.
477 */
479 static ext::shared_ptr<Data> nlgData(
480 new Data("Dutch guilder", "NLG", 528,
481 "f", "", 100,
482 Rounding(),
483 "%3% %1$.2f",
484 EURCurrency()));
485 data_ = nlgData;
486 }
487
488 // Portuguese escudo
489 /* The ISO three-letter code was PTE; the numeric code was 620.
490 It was divided in 100 centavos.
491 */
493 static ext::shared_ptr<Data> pteData(
494 new Data("Portuguese escudo", "PTE", 620,
495 "Esc", "", 100,
496 Rounding(),
497 "%1$.0f %3%",
498 EURCurrency()));
499 data_ = pteData;
500 }
501
502 // Slovak koruna
503 /* The ISO three-letter code is SKK; the numeric code is 703.
504 It is divided in 100 halierov.
505 */
507 static ext::shared_ptr<Data> skkData(
508 new Data("Slovak koruna", "SKK", 703,
509 "Sk", "", 100,
510 Rounding(),
511 "%1$.2f %3%"));
512 data_ = skkData;
513 }
514
515 // Ukrainian hryvnia
516 /* The ISO three-letter code is UAH; the numeric code is 980.
517 It is divided in 100 kopiykas.
518 */
520 static ext::shared_ptr<Data> uahData(
521 new Data("Ukrainian hryvnia", "UAH", 980,
522 "hrn", "", 100,
523 Rounding(),
524 "%1$.2f %3%"));
525 data_ = uahData;
526 }
527
528 // Serbian dinar
530 static ext::shared_ptr<Data> rsdData(
531 new Data("Serbian dinar", "RSD", 941, "RSD", "", 100, Rounding(), "1$.2f %3%"));
532 data_ = rsdData;
533 }
534
535 // Croatian kuna
537 static ext::shared_ptr<Data> hrkData(
538 new Data("Croatian kuna", "HRK", 191, "HRK", "", 100, Rounding(), "1$.2f %3%"));
539 data_ = hrkData;
540 }
541
542 // Bulgarian lev
544 static ext::shared_ptr<Data> bgnData(
545 new Data("Bulgarian lev", "BGN", 975, "BGN", "", 100, Rounding(), "1$.2F %3%"));
546 data_ = bgnData;
547 }
548
549 // Georgian lari
551 static ext::shared_ptr<Data> gelData(
552 new Data("Georgian lari", "GEL", 981, "GEL", "", 100, Rounding(), "1$.2F %3%"));
553 data_ = gelData;
554 }
555}
556
557
Closest rounding.
Definition: rounding.hpp:106
ext::shared_ptr< Data > data_
Definition: currency.hpp:91
European Euro.
Definition: europe.hpp:123
basic rounding class
Definition: rounding.hpp:35
Definition: any.hpp:35