Coverage Report

Created: 2025-11-04 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/currencies/america.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, 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
 <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/america.hpp>
27
28
namespace 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
    */
34
0
    ARSCurrency::ARSCurrency() {
35
0
        static auto arsData = ext::make_shared<Data>("Argentinian peso", "ARS", 32, "", "", 100, Rounding());
36
0
        data_ = arsData;
37
0
    }
38
39
    // Brazilian real
40
    /* The ISO three-letter code is BRL; the numeric code is 986.
41
       It is divided in 100 centavos.
42
    */
43
0
    BRLCurrency::BRLCurrency() {
44
0
        static auto brlData = ext::make_shared<Data>("Brazilian real", "BRL", 986, "R$", "", 100, Rounding());
45
0
        data_ = brlData;
46
0
    }
47
48
    // Canadian dollar
49
    /* The ISO three-letter code is CAD; the numeric code is 124.
50
       It is divided into 100 cents.
51
    */
52
0
    CADCurrency::CADCurrency() {
53
0
        static auto cadData = ext::make_shared<Data>("Canadian dollar", "CAD", 124, "Can$", "", 100, Rounding());
54
0
        data_ = cadData;
55
0
    }
56
57
    // Chilean peso
58
    /* The ISO three-letter code is CLP; the numeric code is 152.
59
      It is divided in 100 centavos.
60
    */
61
0
    CLPCurrency::CLPCurrency() {
62
0
        static auto clpData = ext::make_shared<Data>("Chilean peso", "CLP", 152, "Ch$", "", 100, Rounding());
63
0
        data_ = clpData;
64
0
    }
65
66
    // Colombian peso
67
    /* The ISO three-letter code is COP; the numeric code is 170.
68
       It is divided in 100 centavos.
69
    */
70
0
    COPCurrency::COPCurrency() {
71
0
        static auto copData = ext::make_shared<Data>("Colombian peso", "COP", 170, "Col$", "", 100, Rounding());
72
0
        data_ = copData;
73
0
    }
74
75
    // Mexican peso
76
    /* The ISO three-letter code is MXN; the numeric code is 484.
77
       It is divided in 100 centavos.
78
    */
79
0
    MXNCurrency::MXNCurrency() {
80
0
        static auto mxnData = ext::make_shared<Data>("Mexican peso", "MXN", 484, "Mex$", "", 100, Rounding());
81
0
        data_ = mxnData;
82
0
    }
83
84
    // Peruvian nuevo sol
85
    /* The ISO three-letter code is PEN; the numeric code is 604.
86
       It is divided in 100 centimos.
87
    */
88
0
    PENCurrency::PENCurrency() {
89
0
        static auto penData = ext::make_shared<Data>("Peruvian nuevo sol", "PEN", 604, "S/.", "", 100, Rounding());
90
0
        data_ = penData;
91
0
    }
92
93
    // Peruvian inti
94
    /* The ISO three-letter code was PEI.
95
       It was divided in 100 centimos. A numeric code is not available;
96
       as per ISO 3166-1, we assign 998 as a user-defined code.
97
    */
98
0
    PEICurrency::PEICurrency() {
99
0
        static auto peiData = ext::make_shared<Data>("Peruvian inti", "PEI", 998, "I/.", "", 100, Rounding());
100
0
        data_ = peiData;
101
0
    }
102
103
    // Peruvian sol
104
    /* The ISO three-letter code was PEH. A numeric code is not available;
105
       as per ISO 3166-1, we assign 999 as a user-defined code.
106
       It was divided in 100 centavos.
107
    */
108
0
    PEHCurrency::PEHCurrency() {
109
0
        static auto pehData = ext::make_shared<Data>("Peruvian sol", "PEH", 999, "S./", "", 100, Rounding());
110
0
        data_ = pehData;
111
0
    }
112
113
    // Trinidad & Tobago dollar
114
    /* The ISO three-letter code is TTD; the numeric code is 780.
115
       It is divided in 100 cents.
116
    */
117
0
    TTDCurrency::TTDCurrency() {
118
0
        static auto ttdData = ext::make_shared<Data>("Trinidad & Tobago dollar", "TTD", 780, "TT$", "", 100, Rounding());
119
0
        data_ = ttdData;
120
0
    }
121
122
    // U.S. dollar
123
    /* The ISO three-letter code is USD; the numeric code is 840.
124
       It is divided in 100 cents.
125
    */
126
0
    USDCurrency::USDCurrency() {
127
0
        static auto usdData = ext::make_shared<Data>("U.S. dollar", "USD", 840, "$", "\xA2", 100, Rounding());
128
0
        data_ = usdData;
129
0
    }
130
131
    // Venezuelan bolivar
132
    /* The ISO three-letter code is VEB; the numeric code is 862.
133
       It is divided in 100 centimos.
134
    */
135
0
    VEBCurrency::VEBCurrency() {
136
0
        static auto vebData = ext::make_shared<Data>("Venezuelan bolivar", "VEB", 862, "Bs", "", 100, Rounding());
137
0
        data_ = vebData;
138
0
    }
139
140
    // Mexican Unidad de Inversion
141
0
    MXVCurrency::MXVCurrency() {
142
0
        static auto mxvData = ext::make_shared<Data>("Mexican Unidad de Inversion", "MXV", 979, "MXV", "", 1, Rounding());
143
0
        data_ = mxvData;
144
0
    }
145
146
    // Unidad de Valor Real
147
0
    COUCurrency::COUCurrency() {
148
0
        static auto couData = ext::make_shared<Data>("Unidad de Valor Real (UVR) (funds code)", "COU", 970, "COU", "", 100, Rounding());
149
0
        data_ = couData;
150
0
    }
151
152
    // Unidad de Fomento
153
0
    CLFCurrency::CLFCurrency() {
154
0
        static auto clfData = ext::make_shared<Data>("Unidad de Fomento (funds code)", "CLF", 990, "CLF", "", 1, Rounding());
155
0
        data_ = clfData;
156
0
    }
157
158
    // Uruguayan peso
159
0
    UYUCurrency::UYUCurrency() {
160
0
        static auto uyuData = ext::make_shared<Data>("Uruguayan peso", "UYU", 858, "UYU", "", 1, Rounding());
161
0
        data_ = uyuData;
162
0
    }
163
164
}
165