/src/quantlib/ql/currencies/asia.cpp
Line | Count | Source (jump to first uncovered line) |
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 | | <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/asia.hpp> |
27 | | |
28 | | namespace 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 | | */ |
34 | 0 | BDTCurrency::BDTCurrency() { |
35 | 0 | static auto bdtData = ext::make_shared<Data>("Bangladesh taka", "BDT", 50, "Bt", "", 100, Rounding()); |
36 | 0 | data_ = bdtData; |
37 | 0 | } |
38 | | |
39 | | // Chinese yuan |
40 | | /* The ISO three-letter code is CNY; the numeric code is 156. |
41 | | It is divided in 100 fen. |
42 | | */ |
43 | 0 | CNYCurrency::CNYCurrency() { |
44 | 0 | static auto cnyData = ext::make_shared<Data>("Chinese yuan", "CNY", 156, "Y", "", 100, Rounding()); |
45 | 0 | data_ = cnyData; |
46 | 0 | } |
47 | | |
48 | | // Hong Kong dollar |
49 | | /* The ISO three-letter code is HKD; the numeric code is 344. |
50 | | It is divided in 100 cents. |
51 | | */ |
52 | 0 | HKDCurrency::HKDCurrency() { |
53 | 0 | static auto hkdData = ext::make_shared<Data>("Hong Kong dollar", "HKD", 344, "HK$", "", 100, Rounding()); |
54 | 0 | data_ = hkdData; |
55 | 0 | } |
56 | | |
57 | | // Indonesian Rupiah |
58 | | /* The ISO three-letter code is IDR; the numeric code is 360. |
59 | | It is divided in 100 sen. |
60 | | */ |
61 | 0 | IDRCurrency::IDRCurrency() { |
62 | 0 | static auto idrData = ext::make_shared<Data>("Indonesian Rupiah", "IDR", 360, "Rp", "", 100, Rounding()); |
63 | 0 | data_ = idrData; |
64 | 0 | } |
65 | | |
66 | | // Israeli shekel |
67 | | /* The ISO three-letter code is ILS; the numeric code is 376. |
68 | | It is divided in 100 agorot. |
69 | | */ |
70 | 0 | ILSCurrency::ILSCurrency() { |
71 | 0 | static auto ilsData = ext::make_shared<Data>("Israeli shekel", "ILS", 376, "NIS", "", 100, Rounding()); |
72 | 0 | data_ = ilsData; |
73 | 0 | } |
74 | | |
75 | | // Indian rupee |
76 | | /* The ISO three-letter code is INR; the numeric code is 356. |
77 | | It is divided in 100 paise. |
78 | | */ |
79 | 0 | INRCurrency::INRCurrency() { |
80 | 0 | static auto inrData = ext::make_shared<Data>("Indian rupee", "INR", 356, "Rs", "", 100, Rounding()); |
81 | 0 | data_ = inrData; |
82 | 0 | } |
83 | | |
84 | | // Iraqi dinar |
85 | | /* The ISO three-letter code is IQD; the numeric code is 368. |
86 | | It is divided in 1000 fils. |
87 | | */ |
88 | 0 | IQDCurrency::IQDCurrency() { |
89 | 0 | static auto iqdData = ext::make_shared<Data>("Iraqi dinar", "IQD", 368, "ID", "", 1000, Rounding()); |
90 | 0 | data_ = iqdData; |
91 | 0 | } |
92 | | |
93 | | // Iranian rial |
94 | | /* The ISO three-letter code is IRR; the numeric code is 364. |
95 | | It has no subdivisions. |
96 | | */ |
97 | 0 | IRRCurrency::IRRCurrency() { |
98 | 0 | static auto irrData = ext::make_shared<Data>("Iranian rial", "IRR", 364, "Rls", "", 1, Rounding()); |
99 | 0 | data_ = irrData; |
100 | 0 | } |
101 | | |
102 | | // Japanese yen |
103 | | /* The ISO three-letter code is JPY; the numeric code is 392. |
104 | | It is divided into 100 sen. |
105 | | */ |
106 | 0 | JPYCurrency::JPYCurrency() { |
107 | 0 | static auto jpyData = ext::make_shared<Data>("Japanese yen", "JPY", 392, "\xA5", "", 100, Rounding()); |
108 | 0 | data_ = jpyData; |
109 | 0 | } |
110 | | |
111 | | // South-Korean won |
112 | | /* The ISO three-letter code is KRW; the numeric code is 410. |
113 | | It is divided in 100 chon. |
114 | | */ |
115 | 0 | KRWCurrency::KRWCurrency() { |
116 | 0 | static auto krwData = ext::make_shared<Data>("South-Korean won", "KRW", 410, "W", "", 100, Rounding()); |
117 | 0 | data_ = krwData; |
118 | 0 | } |
119 | | |
120 | | // Kuwaiti dinar |
121 | | /* The ISO three-letter code is KWD; the numeric code is 414. |
122 | | It is divided in 1000 fils. |
123 | | */ |
124 | 0 | KWDCurrency::KWDCurrency() { |
125 | 0 | static auto kwdData = ext::make_shared<Data>("Kuwaiti dinar", "KWD", 414, "KD", "", 1000, Rounding()); |
126 | 0 | data_ = kwdData; |
127 | 0 | } |
128 | | |
129 | | // Kazakstani Tenge |
130 | | /* The ISO three-letter code is KZT; the numeric code is 398. |
131 | | It is divided in 100 tijin. |
132 | | */ |
133 | 0 | KZTCurrency::KZTCurrency() { |
134 | 0 | static auto kztData = ext::make_shared<Data>("Kazakstanti Tenge", "KZT", 398, "Kzt", "", 100, Rounding()); |
135 | 0 | data_ = kztData; |
136 | 0 | } |
137 | | |
138 | | // Malaysian Ringgit |
139 | | /* The ISO three-letter code is MYR; the numeric code is 458. |
140 | | It is divided in 100 sen. |
141 | | */ |
142 | 0 | MYRCurrency::MYRCurrency() { |
143 | 0 | static auto myrData = ext::make_shared<Data>("Malaysian Ringgit", "MYR", 458, "RM", "", 100, Rounding()); |
144 | 0 | data_ = myrData; |
145 | 0 | } |
146 | | |
147 | | // Nepal rupee |
148 | | /* The ISO three-letter code is NPR; the numeric code is 524. |
149 | | It is divided in 100 paise. |
150 | | */ |
151 | 0 | NPRCurrency::NPRCurrency() { |
152 | 0 | static auto nprData = ext::make_shared<Data>("Nepal rupee", "NPR", 524, "NRs", "", 100, Rounding()); |
153 | 0 | data_ = nprData; |
154 | 0 | } |
155 | | |
156 | | // Pakistani rupee |
157 | | /* The ISO three-letter code is PKR; the numeric code is 586. |
158 | | It is divided in 100 paisa. |
159 | | */ |
160 | 0 | PKRCurrency::PKRCurrency() { |
161 | 0 | static auto pkrData = ext::make_shared<Data>("Pakistani rupee", "PKR", 586, "Rs", "", 100, Rounding()); |
162 | 0 | data_ = pkrData; |
163 | 0 | } |
164 | | |
165 | | // Saudi riyal |
166 | | /* The ISO three-letter code is SAR; the numeric code is 682. |
167 | | It is divided in 100 halalat. |
168 | | */ |
169 | 0 | SARCurrency::SARCurrency() { |
170 | 0 | static auto sarData = ext::make_shared<Data>("Saudi riyal", "SAR", 682, "SRls", "", 100, Rounding()); |
171 | 0 | data_ = sarData; |
172 | 0 | } |
173 | | |
174 | | // %Singapore dollar |
175 | | /* The ISO three-letter code is SGD; the numeric code is 702. |
176 | | It is divided in 100 cents. |
177 | | */ |
178 | 0 | SGDCurrency::SGDCurrency() { |
179 | 0 | static auto sgdData = ext::make_shared<Data>("Singapore dollar", "SGD", 702, "S$", "", 100, Rounding()); |
180 | 0 | data_ = sgdData; |
181 | 0 | } |
182 | | |
183 | | // Thai baht |
184 | | /* The ISO three-letter code is THB; the numeric code is 764. |
185 | | It is divided in 100 stang. |
186 | | */ |
187 | 0 | THBCurrency::THBCurrency() { |
188 | 0 | static auto thbData = ext::make_shared<Data>("Thai baht", "THB", 764, "Bht", "", 100, Rounding()); |
189 | 0 | data_ = thbData; |
190 | 0 | } |
191 | | |
192 | | // %Taiwan dollar |
193 | | /* The ISO three-letter code is TWD; the numeric code is 901. |
194 | | It is divided in 100 cents. |
195 | | */ |
196 | 0 | TWDCurrency::TWDCurrency() { |
197 | 0 | static auto twdData = ext::make_shared<Data>("Taiwan dollar", "TWD", 901, "NT$", "", 100, Rounding()); |
198 | 0 | data_ = twdData; |
199 | 0 | } |
200 | | |
201 | | // Vietnamese Dong |
202 | | /* The ISO three-letter code is VND; the numeric code is 704. |
203 | | It was divided in 100 xu. |
204 | | */ |
205 | 0 | VNDCurrency::VNDCurrency() { |
206 | 0 | static auto twdData = ext::make_shared<Data>("Vietnamese Dong", "VND", 704, "", "", 100, Rounding()); |
207 | 0 | data_ = twdData; |
208 | 0 | } |
209 | | |
210 | | // Qatari riyal |
211 | 0 | QARCurrency::QARCurrency() { |
212 | 0 | static auto qarData = ext::make_shared<Data>("Qatari riyal", "QAR", 634, "QAR", "", 100, Rounding()); |
213 | 0 | data_ = qarData; |
214 | 0 | } |
215 | | |
216 | | // Bahraini dinar |
217 | 0 | BHDCurrency::BHDCurrency() { |
218 | 0 | static auto bhdData = ext::make_shared<Data>("Bahraini dinar", "BHD", 48, "BHD", "", 1000, Rounding()); |
219 | 0 | data_ = bhdData; |
220 | 0 | } |
221 | | |
222 | | // Omani rial |
223 | 0 | OMRCurrency::OMRCurrency() { |
224 | 0 | static auto omrData = ext::make_shared<Data>("Omani rial", "OMR", 512, "OMR", "", 1000, Rounding()); |
225 | 0 | data_ = omrData; |
226 | 0 | } |
227 | | |
228 | | // Jordanian dinar |
229 | 0 | JODCurrency::JODCurrency() { |
230 | 0 | static auto jodData = ext::make_shared<Data>("Jordanian dinar", "JOD", 400, "JOD", "", 1000, Rounding()); |
231 | 0 | data_ = jodData; |
232 | 0 | } |
233 | | |
234 | | // United Arab Emirates dirham |
235 | 0 | AEDCurrency::AEDCurrency() { |
236 | 0 | static auto aedData = ext::make_shared<Data>("United Arab Emirates dirham", "AED", 784, "AED", "", 100, Rounding()); |
237 | 0 | data_ = aedData; |
238 | 0 | } |
239 | | |
240 | | // Philippine peso |
241 | 0 | PHPCurrency::PHPCurrency() { |
242 | 0 | static auto phpData = ext::make_shared<Data>("Philippine peso", "PHP", 608, "PHP", "", 100, Rounding()); |
243 | 0 | data_ = phpData; |
244 | 0 | } |
245 | | |
246 | | // Chinese yuan (Hong Kong) |
247 | 0 | CNHCurrency::CNHCurrency() { |
248 | 0 | static auto cnhData = ext::make_shared<Data>("Chinese yuan (Hong Kong)", "CNH", 156, "CNH", "", 100, Rounding()); |
249 | 0 | data_ = cnhData; |
250 | 0 | } |
251 | | |
252 | | // Sri Lankan rupee |
253 | 0 | LKRCurrency::LKRCurrency() { |
254 | 0 | static auto lkrData = ext::make_shared<Data>("Sri Lankan rupee", "LKR", 144, "LKR", "", 100, Rounding()); |
255 | 0 | data_ = lkrData; |
256 | 0 | } |
257 | | |
258 | | } |
259 | | |