1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<meta name="robots" content="none">
<title>QuantLib: Money Class Reference</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="212" height="47" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 0.3.14</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="overview.html">Project overview</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="faq.html">Frequently asked questions</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="todo.html">Todo List</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="deprecated.html">Deprecated Features</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.5.1 -->
<div class="nav">
<b>QuantLib</b>::<a class="el" href="class_quant_lib_1_1_money.html">Money</a></div>
<h1>Money Class Reference</h1><!-- doxytag: class="QuantLib::Money" --><code>#include <ql/money.hpp></code>
<p>
<a href="class_quant_lib_1_1_money-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
amount of cash
<p>
<dl compact><dt><b><a class="el" href="test.html#_test000055">Tests:</a></b></dt><dd>money arithmetic is tested with and without currency conversions. </dd></dl>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Conversion settings</h2></td></tr>
<tr><td colspan="2">These parameters are used for combining money amounts in different currencies <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d107">ConversionType</a> { <a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d10772ed6bc56b64c8b02948e4208525cca7">NoConversion</a>,
<a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d107c8cddb972a63f1d6c5f642aa14b82212">BaseCurrencyConversion</a>,
<a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d107d49f32edf8f7bca53bf83458dd499f39">AutomatedConversion</a>
}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="df033835af8d96a070082ca9ee78ce30"></a><!-- doxytag: member="QuantLib::Money::conversionType" ref="df033835af8d96a070082ca9ee78ce30" args="" -->
static <a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d107">ConversionType</a> </td><td class="memItemRight" valign="bottom"><b>conversionType</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5a5c56ec648313fa5ddadf7a4fb0d025"></a><!-- doxytag: member="QuantLib::Money::baseCurrency" ref="5a5c56ec648313fa5ddadf7a4fb0d025" args="" -->
static <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> </td><td class="memItemRight" valign="bottom"><b>baseCurrency</b></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Inspectors</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="55bc3b2dbe28e58a7a86172ee37404b0"></a><!-- doxytag: member="QuantLib::Money::currency" ref="55bc3b2dbe28e58a7a86172ee37404b0" args="() const" -->
const <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> & </td><td class="memItemRight" valign="bottom"><b>currency</b> () const</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="68fdfaccfdf6faf1ed4e011231bc74f3"></a><!-- doxytag: member="QuantLib::Money::value" ref="68fdfaccfdf6faf1ed4e011231bc74f3" args="() const" -->
Decimal </td><td class="memItemRight" valign="bottom"><b>value</b> () const</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3f2045d802df20d8539471a1d3655bca"></a><!-- doxytag: member="QuantLib::Money::rounded" ref="3f2045d802df20d8539471a1d3655bca" args="() const" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>rounded</b> () const</td></tr>
<tr><td colspan="2"><div class="groupHeader">Money arithmetics</div></td></tr>
<tr><td colspan="2"><div class="groupText">See below for non-member functions and for settings which determine the behavior of the operators. <br><br></div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d7a761333ec81ffaa13464837366f5d7"></a><!-- doxytag: member="QuantLib::Money::operator+" ref="d7a761333ec81ffaa13464837366f5d7" args="() const" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator+</b> () const</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5cf62b081974eb834fbaf16f219906b6"></a><!-- doxytag: member="QuantLib::Money::operator-" ref="5cf62b081974eb834fbaf16f219906b6" args="() const" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator-</b> () const</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0e3fec38ee32ca690a0c9f601783417c"></a><!-- doxytag: member="QuantLib::Money::operator+=" ref="0e3fec38ee32ca690a0c9f601783417c" args="(const Money &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> & </td><td class="memItemRight" valign="bottom"><b>operator+=</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b38f99b9868982e3ca0b51a25f23fb3c"></a><!-- doxytag: member="QuantLib::Money::operator-=" ref="b38f99b9868982e3ca0b51a25f23fb3c" args="(const Money &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> & </td><td class="memItemRight" valign="bottom"><b>operator-=</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="358417157e4179d9c66e876b785fc598"></a><!-- doxytag: member="QuantLib::Money::operator *=" ref="358417157e4179d9c66e876b785fc598" args="(Decimal)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> & </td><td class="memItemRight" valign="bottom"><b>operator *=</b> (Decimal)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c9dd98528eebd18e42868b0297f3fcd1"></a><!-- doxytag: member="QuantLib::Money::operator/=" ref="c9dd98528eebd18e42868b0297f3fcd1" args="(Decimal)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> & </td><td class="memItemRight" valign="bottom"><b>operator/=</b> (Decimal)</td></tr>
<tr><td colspan="2"><br><h2>Related Functions</h2></td></tr>
<tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1f495f020f64c7b177b9e1bc0f99139c"></a><!-- doxytag: member="QuantLib::Money::operator+" ref="1f495f020f64c7b177b9e1bc0f99139c" args="(const Money &, const Money &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator+</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4a130afeac5bc99d0a00e6005dd2fce0"></a><!-- doxytag: member="QuantLib::Money::operator-" ref="4a130afeac5bc99d0a00e6005dd2fce0" args="(const Money &, const Money &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator-</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="852c96b8ac713f7ebdb823c5eb8b0d09"></a><!-- doxytag: member="QuantLib::Money::operator *" ref="852c96b8ac713f7ebdb823c5eb8b0d09" args="(const Money &, Decimal)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator *</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, Decimal)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="54efede28105a0f12a35874d69742c58"></a><!-- doxytag: member="QuantLib::Money::operator *" ref="54efede28105a0f12a35874d69742c58" args="(Decimal, const Money &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator *</b> (Decimal, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="91bb0ba24a70226c3a6dd585ffb15537"></a><!-- doxytag: member="QuantLib::Money::operator/" ref="91bb0ba24a70226c3a6dd585ffb15537" args="(const Money &, Decimal)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator/</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, Decimal)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="31eae46b487ee5e972e0e598351edfa6"></a><!-- doxytag: member="QuantLib::Money::operator/" ref="31eae46b487ee5e972e0e598351edfa6" args="(const Money &, const Money &)" -->
Decimal </td><td class="memItemRight" valign="bottom"><b>operator/</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2f2e363600f64a5a2447cd706a4718fc"></a><!-- doxytag: member="QuantLib::Money::operator==" ref="2f2e363600f64a5a2447cd706a4718fc" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator==</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3097af686d116996f32c88433b488f51"></a><!-- doxytag: member="QuantLib::Money::operator!=" ref="3097af686d116996f32c88433b488f51" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1dac0cd307438b7659c9af74bb50b4ee"></a><!-- doxytag: member="QuantLib::Money::operator<" ref="1dac0cd307438b7659c9af74bb50b4ee" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator<</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="567e24d5625a08c9c0685a51df245cce"></a><!-- doxytag: member="QuantLib::Money::operator<=" ref="567e24d5625a08c9c0685a51df245cce" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator<=</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fcb0842cc75edc7a10019e72709a249e"></a><!-- doxytag: member="QuantLib::Money::operator>" ref="fcb0842cc75edc7a10019e72709a249e" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator></b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f8258e94ec653301a5d6e7b68c85c24f"></a><!-- doxytag: member="QuantLib::Money::operator>=" ref="f8258e94ec653301a5d6e7b68c85c24f" args="(const Money &, const Money &)" -->
bool </td><td class="memItemRight" valign="bottom"><b>operator>=</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2a41991b16dc3c024a6e10d61a1ba47f"></a><!-- doxytag: member="QuantLib::Money::close" ref="2a41991b16dc3c024a6e10d61a1ba47f" args="(const Money &, const Money &, Size n=42)" -->
bool </td><td class="memItemRight" valign="bottom"><b>close</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, Size n=42)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c5af9d7a914bb1d00f3beb1076228755"></a><!-- doxytag: member="QuantLib::Money::close_enough" ref="c5af9d7a914bb1d00f3beb1076228755" args="(const Money &, const Money &, Size n=42)" -->
bool </td><td class="memItemRight" valign="bottom"><b>close_enough</b> (const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &, Size n=42)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="63a868c7db5ba272e11d381fe670c1e1"></a><!-- doxytag: member="QuantLib::Money::operator *" ref="63a868c7db5ba272e11d381fe670c1e1" args="(Decimal, const Currency &)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator *</b> (Decimal, const <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> &)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dd9c2ac079154ff558b9e090b783b1b8"></a><!-- doxytag: member="QuantLib::Money::operator *" ref="dd9c2ac079154ff558b9e090b783b1b8" args="(const Currency &, Decimal)" -->
<a class="el" href="class_quant_lib_1_1_money.html">Money</a> </td><td class="memItemRight" valign="bottom"><b>operator *</b> (const <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> &, Decimal)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="867d4d15a525b67992fceb19eaf832b0"></a><!-- doxytag: member="QuantLib::Money::operator<<" ref="867d4d15a525b67992fceb19eaf832b0" args="(std::ostream &, const Money &)" -->
std::ostream & </td><td class="memItemRight" valign="bottom"><b>operator<<</b> (std::ostream &, const <a class="el" href="class_quant_lib_1_1_money.html">Money</a> &)</td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="c32291f3a839fe01ad0708ab8c53d107"></a><!-- doxytag: member="QuantLib::Money::ConversionType" ref="c32291f3a839fe01ad0708ab8c53d107" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="class_quant_lib_1_1_money.html#c32291f3a839fe01ad0708ab8c53d107">ConversionType</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="c32291f3a839fe01ad0708ab8c53d10772ed6bc56b64c8b02948e4208525cca7"></a><!-- doxytag: member="NoConversion" ref="c32291f3a839fe01ad0708ab8c53d10772ed6bc56b64c8b02948e4208525cca7" args="" -->NoConversion</em> </td><td>
do not perform conversions </td></tr>
<tr><td valign="top"><em><a class="anchor" name="c32291f3a839fe01ad0708ab8c53d107c8cddb972a63f1d6c5f642aa14b82212"></a><!-- doxytag: member="BaseCurrencyConversion" ref="c32291f3a839fe01ad0708ab8c53d107c8cddb972a63f1d6c5f642aa14b82212" args="" -->BaseCurrencyConversion</em> </td><td>
convert both operands to the base currency before converting </td></tr>
<tr><td valign="top"><em><a class="anchor" name="c32291f3a839fe01ad0708ab8c53d107d49f32edf8f7bca53bf83458dd499f39"></a><!-- doxytag: member="AutomatedConversion" ref="c32291f3a839fe01ad0708ab8c53d107d49f32edf8f7bca53bf83458dd499f39" args="" -->AutomatedConversion</em> </td><td>
return the result in the currency of the first operand </td></tr>
</table>
</dl>
</div>
</div><p>
</div>
<div class="footer">
<table align="top" width="100%">
<tr>
<td align="middle" width="33%">
<strong>QuantLib.org</strong><br>
<a href="http://quantlib.org/">
<img src="QL-small.jpg" alt="QuantLib" align="middle" border=0>
</a>
</td>
<td align="middle" width="33%">
<strong>Hosted by</strong><br>
<a href="http://sourceforge.net"><img src=
"sfnetlogo.png" width="88" height="31"
border="0" alt="SourceForge.net Logo"></a>
</td>
<td align="middle" width="33%">
<strong>Documentation generated by</strong><br>
<a href="http://www.doxygen.org">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53>
</a></td>
</tr>
</table>
</div>
</div>
</body>
</html>
|