Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 6a806edc410677c1fd1cd473b6901408 > files > 66

ghc-hledger-lib-devel-0.14-2.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Hledger.Data.Amount</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Hledger-Data-Amount.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Hledger-Data-Amount.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hledger-lib-0.14: Reusable types and utilities for the hledger accounting tool and financial apps in general.</p></div><div id="content"><div id="module-header"><p class="caption">Hledger.Data.Amount</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>An <code><a href="Hledger-Data-Types.html#t:Amount">Amount</a></code> is some quantity of money, shares, or anything else.
</p><p>A simple amount is a <code><a href="Hledger-Data-Types.html#t:Commodity">Commodity</a></code>, quantity pair:
</p><pre>
  $1 
  -50
  EUR 3.44 
  GOOG 500
  1.5h
  90 apples
  0 
</pre><p>An amount may also have a per-unit price, or conversion rate, in terms
of some other commodity. If present, this is displayed after @:
</p><pre>
  EUR 3 @ $1.35
</pre><p>A <code><a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></code> is zero or more simple amounts.  Mixed amounts are
usually normalised so that there is no more than one amount in each
commodity, and no zero amounts (or, there is just a single zero amount
and no others.):
</p><pre>
  $50 + EUR 3
  16h + $13.55 + AAPL 500 + 6 oranges
  0
</pre><p>We can do limited arithmetic with simple or mixed amounts: either
price-preserving arithmetic with similarly-priced amounts, or
price-discarding arithmetic which ignores and discards prices.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:amounts">amounts</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; [<a href="Hledger-Data-Types.html#t:Amount">Amount</a>]</li><li class="src short"><a href="#v:canonicaliseAmount">canonicaliseAmount</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a>) -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:canonicaliseMixedAmount">canonicaliseMixedAmount</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a>) -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:convertMixedAmountToSimilarCommodity">convertMixedAmountToSimilarCommodity</a> :: <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:costOfAmount">costOfAmount</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:costOfMixedAmount">costOfMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:divideAmount">divideAmount</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:divideMixedAmount">divideMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:isNegativeMixedAmount">isNegativeMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isReallyZeroMixedAmountCost">isReallyZeroMixedAmountCost</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isZeroMixedAmount">isZeroMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:maxprecision">maxprecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:maxprecisionwithpoint">maxprecisionwithpoint</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:missingamt">missingamt</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:normaliseMixedAmount">normaliseMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:nullamt">nullamt</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:nullmixedamt">nullmixedamt</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:punctuatethousands">punctuatethousands</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:setAmountPrecision">setAmountPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a></li><li class="src short"><a href="#v:setMixedAmountPrecision">setMixedAmountPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:showAmountDebug">showAmountDebug</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmount">showMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmountDebug">showMixedAmountDebug</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmountOrZero">showMixedAmountOrZero</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmountOrZeroWithoutPrice">showMixedAmountOrZeroWithoutPrice</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmountWithoutPrice">showMixedAmountWithoutPrice</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:showMixedAmountWithPrecision">showMixedAmountWithPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:sumMixedAmountsPreservingHighestPrecision">sumMixedAmountsPreservingHighestPrecision</a> :: [<a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a>] -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a></li><li class="src short"><a href="#v:tests_Hledger_Data_Amount">tests_Hledger_Data_Amount</a> :: <a href="/usr/share/doc/ghc/html/libraries/HUnit-1.2.2.3/Test-HUnit-Base.html#t:Test">Test</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:amounts" class="def">amounts</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; [<a href="Hledger-Data-Types.html#t:Amount">Amount</a>]<a href="src/Hledger-Data-Amount.html#amounts" class="link">Source</a></p><div class="doc"><p>Access a mixed amount's components.
</p></div></div><div class="top"><p class="src"><a name="v:canonicaliseAmount" class="def">canonicaliseAmount</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a>) -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#canonicaliseAmount" class="link">Source</a></p><div class="doc"><p>Set an amount's commodity to the canonicalised commodity from
 the provided commodity map.
</p></div></div><div class="top"><p class="src"><a name="v:canonicaliseMixedAmount" class="def">canonicaliseMixedAmount</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a>) -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#canonicaliseMixedAmount" class="link">Source</a></p><div class="doc"><p>Set a mixed amount's commodity to the canonicalised commodity from
 the provided commodity map.
</p></div></div><div class="top"><p class="src"><a name="v:convertMixedAmountToSimilarCommodity" class="def">convertMixedAmountToSimilarCommodity</a> :: <a href="Hledger-Data-Types.html#t:Commodity">Commodity</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#convertMixedAmountToSimilarCommodity" class="link">Source</a></p><div class="doc"><p>Convert a mixed amount to the specified commodity, assuming an exchange rate of 1.
</p></div></div><div class="top"><p class="src"><a name="v:costOfAmount" class="def">costOfAmount</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#costOfAmount" class="link">Source</a></p><div class="doc"><p>Convert an amount to the commodity of its saved price, if any.  Notes:
 - price amounts must be MixedAmounts with exactly one component Amount (or there will be a runtime error)
 - price amounts should be positive, though this is not currently enforced
</p></div></div><div class="top"><p class="src"><a name="v:costOfMixedAmount" class="def">costOfMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#costOfMixedAmount" class="link">Source</a></p><div class="doc"><p>Convert a mixed amount's component amounts to the commodity of their
 saved price, if any.
</p></div></div><div class="top"><p class="src"><a name="v:divideAmount" class="def">divideAmount</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#divideAmount" class="link">Source</a></p><div class="doc"><p>Divide an amount's quantity by some constant.
</p></div></div><div class="top"><p class="src"><a name="v:divideMixedAmount" class="def">divideMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#divideMixedAmount" class="link">Source</a></p><div class="doc"><p>Divide a mixed amount's quantities by some constant.
</p></div></div><div class="top"><p class="src"><a name="v:isNegativeMixedAmount" class="def">isNegativeMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Hledger-Data-Amount.html#isNegativeMixedAmount" class="link">Source</a></p><div class="doc"><p>Is this mixed amount negative, if it can be normalised to a single commodity ?
</p></div></div><div class="top"><p class="src"><a name="v:isReallyZeroMixedAmountCost" class="def">isReallyZeroMixedAmountCost</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Hledger-Data-Amount.html#isReallyZeroMixedAmountCost" class="link">Source</a></p><div class="doc"><p>Is this mixed amount <a href="really.html">really</a> zero, after converting to cost
 commodities where possible ?
</p></div></div><div class="top"><p class="src"><a name="v:isZeroMixedAmount" class="def">isZeroMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a><a href="src/Hledger-Data-Amount.html#isZeroMixedAmount" class="link">Source</a></p><div class="doc"><p>Does this mixed amount appear to be zero when displayed with its given precision ?
</p></div></div><div class="top"><p class="src"><a name="v:maxprecision" class="def">maxprecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Hledger-Data-Amount.html#maxprecision" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:maxprecisionwithpoint" class="def">maxprecisionwithpoint</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a><a href="src/Hledger-Data-Amount.html#maxprecisionwithpoint" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:missingamt" class="def">missingamt</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#missingamt" class="link">Source</a></p><div class="doc"><p>A temporary value for parsed transactions which had no amount specified.
</p></div></div><div class="top"><p class="src"><a name="v:normaliseMixedAmount" class="def">normaliseMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#normaliseMixedAmount" class="link">Source</a></p><div class="doc"><p>Simplify a mixed amount by removing redundancy in its component amounts, as follows:
 1. sum amounts which have the same commodity (ignoring their price)
 2. remove zero amounts
 3. if there are no amounts at all, add a single zero amount
</p></div></div><div class="top"><p class="src"><a name="v:nullamt" class="def">nullamt</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#nullamt" class="link">Source</a></p><div class="doc"><p>The empty simple amount.
</p></div></div><div class="top"><p class="src"><a name="v:nullmixedamt" class="def">nullmixedamt</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#nullmixedamt" class="link">Source</a></p><div class="doc"><p>The empty mixed amount.
</p></div></div><div class="top"><p class="src"><a name="v:punctuatethousands" class="def">punctuatethousands</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#punctuatethousands" class="link">Source</a></p><div class="doc"><p>Add thousands-separating commas to a decimal number string
</p></div></div><div class="top"><p class="src"><a name="v:setAmountPrecision" class="def">setAmountPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a><a href="src/Hledger-Data-Amount.html#setAmountPrecision" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:setMixedAmountPrecision" class="def">setMixedAmountPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#setMixedAmountPrecision" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:showAmountDebug" class="def">showAmountDebug</a> :: <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showAmountDebug" class="link">Source</a></p><div class="doc"><p>Get the unambiguous string representation of an amount, for debugging.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmount" class="def">showMixedAmount</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmount" class="link">Source</a></p><div class="doc"><p>Get the string representation of a mixed amount, showing each of
 its component amounts. NB a mixed amount can have an empty amounts
 list in which case it shows as &quot;&quot;.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmountDebug" class="def">showMixedAmountDebug</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmountDebug" class="link">Source</a></p><div class="doc"><p>Get an unambiguous string representation of a mixed amount for debugging.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmountOrZero" class="def">showMixedAmountOrZero</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmountOrZero" class="link">Source</a></p><div class="doc"><p>Get the string representation of a mixed amount, and if it
 appears to be all zero just show a bare 0, ledger-style.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmountOrZeroWithoutPrice" class="def">showMixedAmountOrZeroWithoutPrice</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmountOrZeroWithoutPrice" class="link">Source</a></p><div class="doc"><p>Get the string representation of a mixed amount, or a bare 0,
 without any @ prices.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmountWithoutPrice" class="def">showMixedAmountWithoutPrice</a> :: <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmountWithoutPrice" class="link">Source</a></p><div class="doc"><p>Get the string representation of a mixed amount, but without
 any @ prices.
</p></div></div><div class="top"><p class="src"><a name="v:showMixedAmountWithPrecision" class="def">showMixedAmountWithPrecision</a> :: <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a><a href="src/Hledger-Data-Amount.html#showMixedAmountWithPrecision" class="link">Source</a></p><div class="doc"><p>Get the string representation of a mixed amount, showing each of its
 component amounts with the specified precision, ignoring their
 commoditys' display precision settings. NB a mixed amount can have an
 empty amounts list in which case it shows as &quot;&quot;.
</p></div></div><div class="top"><p class="src"><a name="v:sumMixedAmountsPreservingHighestPrecision" class="def">sumMixedAmountsPreservingHighestPrecision</a> :: [<a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a>] -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a><a href="src/Hledger-Data-Amount.html#sumMixedAmountsPreservingHighestPrecision" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:tests_Hledger_Data_Amount" class="def">tests_Hledger_Data_Amount</a> :: <a href="/usr/share/doc/ghc/html/libraries/HUnit-1.2.2.3/Test-HUnit-Base.html#t:Test">Test</a><a href="src/Hledger-Data-Amount.html#tests_Hledger_Data_Amount" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>