QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
asia.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 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 // Bangladesh taka
31 /* The ISO three-letter code is BDT; the numeric code is 50.
32 It is divided in 100 paisa.
33 */
35 static ext::shared_ptr<Data> bdtData(
36 new Data("Bangladesh taka", "BDT", 50,
37 "Bt", "", 100,
38 Rounding(),
39 "%3% %1$.2f"));
40 data_ = bdtData;
41 }
42
43 // Chinese yuan
44 /* The ISO three-letter code is CNY; the numeric code is 156.
45 It is divided in 100 fen.
46 */
48 static ext::shared_ptr<Data> cnyData(
49 new Data("Chinese yuan", "CNY", 156,
50 "Y", "", 100,
51 Rounding(),
52 "%3% %1$.2f"));
53 data_ = cnyData;
54 }
55
56 // Hong Kong dollar
57 /* The ISO three-letter code is HKD; the numeric code is 344.
58 It is divided in 100 cents.
59 */
61 static ext::shared_ptr<Data> hkdData(
62 new Data("Hong Kong dollar", "HKD", 344,
63 "HK$", "", 100,
64 Rounding(),
65 "%3% %1$.2f"));
66 data_ = hkdData;
67 }
68
69 // Indonesian Rupiah
70 /* The ISO three-letter code is IDR; the numeric code is 360.
71 It is divided in 100 sen.
72 */
74 static ext::shared_ptr<Data> idrData(
75 new Data("Indonesian Rupiah", "IDR", 360,
76 "Rp", "", 100,
77 Rounding(),
78 "%3% %1$.2f"));
79 data_ = idrData;
80 }
81
82 // Israeli shekel
83 /* The ISO three-letter code is ILS; the numeric code is 376.
84 It is divided in 100 agorot.
85 */
87 static ext::shared_ptr<Data> ilsData(
88 new Data("Israeli shekel", "ILS", 376,
89 "NIS", "", 100,
90 Rounding(),
91 "%1$.2f %3%"));
92 data_ = ilsData;
93 }
94
95 // Indian rupee
96 /* The ISO three-letter code is INR; the numeric code is 356.
97 It is divided in 100 paise.
98 */
100 static ext::shared_ptr<Data> inrData(
101 new Data("Indian rupee", "INR", 356,
102 "Rs", "", 100,
103 Rounding(),
104 "%3% %1$.2f"));
105 data_ = inrData;
106 }
107
108 // Iraqi dinar
109 /* The ISO three-letter code is IQD; the numeric code is 368.
110 It is divided in 1000 fils.
111 */
113 static ext::shared_ptr<Data> iqdData(
114 new Data("Iraqi dinar", "IQD", 368,
115 "ID", "", 1000,
116 Rounding(),
117 "%2% %1$.3f"));
118 data_ = iqdData;
119 }
120
121 // Iranian rial
122 /* The ISO three-letter code is IRR; the numeric code is 364.
123 It has no subdivisions.
124 */
126 static ext::shared_ptr<Data> irrData(
127 new Data("Iranian rial", "IRR", 364,
128 "Rls", "", 1,
129 Rounding(),
130 "%3% %1$.2f"));
131 data_ = irrData;
132 }
133
134 // Japanese yen
135 /* The ISO three-letter code is JPY; the numeric code is 392.
136 It is divided into 100 sen.
137 */
139 static ext::shared_ptr<Data> jpyData(
140 new Data("Japanese yen", "JPY", 392,
141 "\xA5", "", 100,
142 Rounding(),
143 "%3% %1$.0f"));
144 data_ = jpyData;
145 }
146
147 // South-Korean won
148 /* The ISO three-letter code is KRW; the numeric code is 410.
149 It is divided in 100 chon.
150 */
152 static ext::shared_ptr<Data> krwData(
153 new Data("South-Korean won", "KRW", 410,
154 "W", "", 100,
155 Rounding(),
156 "%3% %1$.0f"));
157 data_ = krwData;
158 }
159
160 // Kuwaiti dinar
161 /* The ISO three-letter code is KWD; the numeric code is 414.
162 It is divided in 1000 fils.
163 */
165 static ext::shared_ptr<Data> kwdData(
166 new Data("Kuwaiti dinar", "KWD", 414,
167 "KD", "", 1000,
168 Rounding(),
169 "%3% %1$.3f"));
170 data_ = kwdData;
171 }
172
173 // Kazakstani Tenge
174 /* The ISO three-letter code is KZT; the numeric code is 398.
175 It is divided in 100 tijin.
176 */
178 static ext::shared_ptr<Data> kztData(
179 new Data("Kazakstanti Tenge", "KZT", 398,
180 "Kzt", "", 100,
181 Rounding(),
182 "%3% %1$.3f"));
183 data_ = kztData;
184 }
185 // Malaysian Ringgit
186 /* The ISO three-letter code is MYR; the numeric code is 458.
187 It is divided in 100 sen.
188 */
190 static ext::shared_ptr<Data> myrData(
191 new Data("Malaysian Ringgit",
192 "MYR", 458,
193 "RM", "", 100,
194 Rounding(),
195 "%3% %1$.2f"));
196 data_ = myrData;
197 }
198
199
200 // Nepal rupee
201 /* The ISO three-letter code is NPR; the numeric code is 524.
202 It is divided in 100 paise.
203 */
205 static ext::shared_ptr<Data> nprData(
206 new Data("Nepal rupee", "NPR", 524,
207 "NRs", "", 100,
208 Rounding(),
209 "%3% %1$.2f"));
210 data_ = nprData;
211 }
212
213 // Pakistani rupee
214 /* The ISO three-letter code is PKR; the numeric code is 586.
215 It is divided in 100 paisa.
216 */
218 static ext::shared_ptr<Data> pkrData(
219 new Data("Pakistani rupee", "PKR", 586,
220 "Rs", "", 100,
221 Rounding(),
222 "%3% %1$.2f"));
223 data_ = pkrData;
224 }
225
226 // Saudi riyal
227 /* The ISO three-letter code is SAR; the numeric code is 682.
228 It is divided in 100 halalat.
229 */
231 static ext::shared_ptr<Data> sarData(
232 new Data("Saudi riyal", "SAR", 682,
233 "SRls", "", 100,
234 Rounding(),
235 "%3% %1$.2f"));
236 data_ = sarData;
237 }
238
239 // %Singapore dollar
240 /* The ISO three-letter code is SGD; the numeric code is 702.
241 It is divided in 100 cents.
242 */
244 static ext::shared_ptr<Data> sgdData(
245 new Data("Singapore dollar", "SGD", 702,
246 "S$", "", 100,
247 Rounding(),
248 "%3% %1$.2f"));
249 data_ = sgdData;
250 }
251
252 // Thai baht
253 /* The ISO three-letter code is THB; the numeric code is 764.
254 It is divided in 100 stang.
255 */
257 static ext::shared_ptr<Data> thbData(
258 new Data("Thai baht", "THB", 764,
259 "Bht", "", 100,
260 Rounding(),
261 "%1$.2f %3%"));
262 data_ = thbData;
263 }
264
265 // %Taiwan dollar
266 /* The ISO three-letter code is TWD; the numeric code is 901.
267 It is divided in 100 cents.
268 */
270 static ext::shared_ptr<Data> twdData(
271 new Data("Taiwan dollar", "TWD", 901,
272 "NT$", "", 100,
273 Rounding(),
274 "%3% %1$.2f"));
275 data_ = twdData;
276 }
277
278 // Vietnamese Dong
279 /* The ISO three-letter code is VND; the numeric code is 704.
280 It was divided in 100 xu.
281 */
283 static ext::shared_ptr<Data> twdData(
284 new Data("Vietnamese Dong", "VND", 704,
285 "", "", 100,
286 Rounding(),
287 "%1$.0f %3%"));
288 data_ = twdData;
289 }
290
291 // Qatari riyal
293 static ext::shared_ptr<Data> qarData(
294 new Data("Qatari riyal", "QAR", 634, "QAR", "", 100, Rounding(), "1$.2f %3%"));
295 data_ = qarData;
296 }
297
298 // Bahraini dinar
300 static ext::shared_ptr<Data> bhdData(
301 new Data("Bahraini dinar", "BHD", 48, "BHD", "", 1000, Rounding(), "1$.2f %3%"));
302 data_ = bhdData;
303 }
304
305 // Omani rial
307 static ext::shared_ptr<Data> omrData(
308 new Data("Omani rial", "OMR", 512, "OMR", "", 1000, Rounding(), "1$.2f %3%"));
309 data_ = omrData;
310 }
311
312 // Jordanian dinar
314 static ext::shared_ptr<Data> jodData(
315 new Data("Jordanian dinar", "JOD", 400, "JOD", "", 1000, Rounding(), "1$.2f %3%"));
316 data_ = jodData;
317 }
318
319 // United Arab Emirates dirham
321 static ext::shared_ptr<Data> aedData(new Data("United Arab Emirates dirham", "AED", 784,
322 "AED", "", 100, Rounding(), "1$.2f %3%"));
323 data_ = aedData;
324 }
325
326 // Philippine peso
328 static ext::shared_ptr<Data> phpData(
329 new Data("Philippine peso", "PHP", 608, "PHP", "", 100, Rounding(), "1$.2f %3%"));
330 data_ = phpData;
331 }
332
333 // Chinese yuan (Hong Kong)
335 static ext::shared_ptr<Data> cnhData(new Data("Chinese yuan (Hong Kong)", "CNH", 156,
336 "CNH", "", 100, Rounding(), "%3% %1$.2f"));
337 data_ = cnhData;
338 }
339
340 // Sri Lankan rupee
342 static ext::shared_ptr<Data> lkrData(
343 new Data("Sri Lankan rupee", "LKR", 144, "LKR", "", 100, Rounding(), "1$.2f %3%"));
344 data_ = lkrData;
345 }
346
347}
348
Asian currencies.
ext::shared_ptr< Data > data_
Definition: currency.hpp:108
basic rounding class
Definition: rounding.hpp:35
Definition: any.hpp:35