<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>let x=x &#187; money</title>
	<atom:link href="http://www.crazymcphee.net/x/tag/money/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crazymcphee.net/x</link>
	<description>programming idiom and methodology</description>
	<lastBuildDate>Fri, 27 Jan 2012 09:36:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Managing to the numbers &#124; Keep the Joint Running</title>
		<link>http://www.crazymcphee.net/x/2010/08/11/managing-to-the-numbers-keep-the-joint-running/</link>
		<comments>http://www.crazymcphee.net/x/2010/08/11/managing-to-the-numbers-keep-the-joint-running/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 01:13:24 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[money]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=580</guid>
		<description><![CDATA[People who manage purely by revenue or share price generally shaft their companies in the medium term. Bob Lewis, of IT Catalysts, is always worth a read and has many insights which I think all developers and architects should pay attention to. So you improve fulfillment (improved quality) and customer service (reduced cycle time). Revenue [...]]]></description>
			<content:encoded><![CDATA[<p>People who manage purely by revenue or share price generally shaft their companies in the medium term. Bob Lewis, of IT Catalysts, is always worth a read and has many insights which I think all developers and architects should pay attention to.</p>
<blockquote><p>So you improve fulfillment (improved quality) and customer service  (reduced cycle time). Revenue increases. Try proving your improvements  were the cause.</p>
<p>You can’t. You can’t even measure customer satisfaction accurately,  let alone demonstrate its relationship to increased revenue.</p>
<p>Which is why those who “run a company by the numbers” so often rely  on mindless cost-cutting: They can easily prove the connection to  this-year bottom-line improvements, while those who complain about the  long-term consequential damage have no proof — only their knowledge of  and confidence in the business model.</p></blockquote>
<p><a href="http://www.weblog.keepthejointrunning.com/?p=3682">Managing to the numbers | Bob Lewis @ Keep The Joint Running</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2010/08/11/managing-to-the-numbers-keep-the-joint-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Money-is-Money 0.17</title>
		<link>http://www.crazymcphee.net/x/2009/12/04/money-is-money-0-17/</link>
		<comments>http://www.crazymcphee.net/x/2009/12/04/money-is-money-0-17/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 08:52:12 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[money-is-money]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=498</guid>
		<description><![CDATA[I just released a new version of Money-Is-Money, v0.17. If you&#8217;re interested, see the features here and here. My aim with it is to make the most accurate currency-aware Java money handling library available. This time I&#8217;ve added just a couple of new methods to get the whole and fractional amounts as Integers (I use [...]]]></description>
			<content:encoded><![CDATA[<p>I just released a new version of Money-Is-Money, v0.17. If you&#8217;re interested, see the features <a href="http://www.crazymcphee.net/x/2009/04/17/money-is-money-v016/">here</a> and <a href="http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/">here</a>. My aim with it is to make the most accurate currency-aware Java money handling library available. This time I&#8217;ve added just a couple of new methods to get the whole and fractional amounts as Integers (I use throughout BigDecimal and BigInteger to represent amounts, to avoid the fatal floating point errors).</p>
<p>To include it into your Maven POM you&#8217;ll have to add my repository to a profile in your settings.xml:</p>
<pre class="code" lang="xml">&lt;repositories&gt;
  &lt;repository&gt;
    &lt;id&gt;crazy-mcphee&lt;/id&gt;
    &lt;url&gt;http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local&lt;/url&gt;
    &lt;snapshots&gt;
      &lt;enabled&gt;false&lt;/enabled&gt;
    &lt;/snapshots&gt;
    &lt;releases&gt;
      &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;/releases&gt;
  &lt;/repository&gt;
&lt;/repositories&gt;</pre>
<p>At which point you can include the dependency in your pom.xml for your project:</p>
<pre class="code" lang="xml">&lt;dependency&gt;
  &lt;groupId&gt;org.autonomous&lt;/groupId&gt;
  &lt;artifactId&gt;money-is-money&lt;/artifactId&gt;
  &lt;version&gt;0.17&lt;/version&gt;
&lt;/dependency&gt;</pre>
<p>If you want to check the source code out with SVN the release is at <em>http://crazymcphee.net/svn/money/tags/money-is-money-0.17</em> and the latest trunk at <em>http://crazymcphee.net/svn/money/trunk</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/12/04/money-is-money-0-17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Money-is-Money v0.16</title>
		<link>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v016/</link>
		<comments>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v016/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 13:56:59 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=327</guid>
		<description><![CDATA[Putting money-is-money into my own Maven repository gave the impetus to me to clean up the actual code base of the library. There are now a grand total of three classes, including an interface, which is much reduced. As anyone who knows me, will know that I think this is a great improvement. See this [...]]]></description>
			<content:encoded><![CDATA[<p>Putting money-is-money into my own <a title="v0.15 with maven repository" href="http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/" target="_self">Maven repository</a> gave the impetus to me to clean up the actual code base of the library. There are now a grand total of <em>three</em> classes, including an interface, which is <em>much</em> reduced. As anyone who knows me, will know that I think this is a great improvement. See <a href="http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/" target="_self">this post </a>- also linked in the first sentence above &#8211; to learn the details of the Maven repository and how and where to get the source code check out.</p>
<p>You can manually browse the artefacts in the repository <a href="http://modular.autonomous.org/artifactory-2.0.5/libs-releases-local/org/autonomous/money-is-money/0.16/">here</a>.</p>
<p>Here&#8217;s the updated README:</p>
<blockquote><p>This package is copyright 2008-2009 Scot Mcphee.</p>
<p>Email: scot.mcphee at gmail.com</p>
<p>Licence is the M.I.T. Licence. Please see the file &#8220;LICENCE&#8221;.</p>
<p>WHAT IS Money-Is-Money?</p>
<p>Money-Is-Money is a library for the correct manipulation of monetary data. I wrote this small library because I found that there were not any available public source Money implementations, despite some Time-based libraries promising such (I guess Time is more interesting to programmers than filthy lucre).</p>
<p>It consists primarily of an interface, called &#8216;Money&#8217;, and a Factory for making money, called &#8216;MoneyMaker&#8217;. There is a single implementation classes, MoneyAmount.</p>
<p>Money uses BigDecimal throughout to represent values. Yes, that&#8217;s a java.math.BigDecimal. If you whine about wanting to use doubles and floats congratulations! You are the target audience and therefore you should *really* be using this library and I won&#8217;t go into debate here why it&#8217;s wrong to use floating point logic in  Money implementations.</p>
<p>Money is designed to be an immutable object. All operations on Money, such as Money.add(Money) returns a new instance of Money representing the added amounts. There are operations for add, subtract, divide, and multiply. The default rounding mode is HALF_EVEN or &#8216;bankers rounding&#8217;. If a value comes out to 0.5, it is rounded to the EVEN value, so $3.555 at  a precision of 2 decimal places becomes 3.56, and so does $3.565. Divide and multiply also include methods to perform those operations with a user-specified rounding mode. There are also methods to do high-precision &#8220;no rounding&#8221; division and multiplication (dividePrecise and multiplyPrecise), which will throw an ArithmeticException if the decimals cannot be terminated and therefore have no decimal representation, e.g. 10/3, so be careful in using it.</p>
<p>There is also two methods to &#8216;proRate&#8217; money. The first takes the existing money and divides it up as equally as possible into the number of buckets you specify, with the modulo distributed in as small as increments as possible across as many of the buckets as possible.</p>
<p>This is NOT THE SAME as dividing by the number you specify. So $10.00 divided into 3 buckets results in buckets containing $3.34, $3.33, $3.33. The specification is that adding the buckets back up should always result in the original amount without any rounding errors. You should be able to pro rate an amount, then pro rate those amounts, recursively many many times and adding up all the &#8216;leaf&#8217; values will result in EXACTLY the original amount.</p>
<p>There is an additional method of &#8216;proRate&#8217;. That is the weighted pro-rate, proRateWeighted. It allows you divide a money amount into a number of buckets with each amount weighted according to a value in an array. E.g. an array of {1, 2} divides the amount into 2 buckets, the first one having 1/3 of the amount, the second 2/3. This can get much more complex than that simple example, e.g. consider $54 divided by the weights {1, 1, 2, 3, 5, 8, 13, 21}. Well in that case I am cheating because the amounts returned would be {1, 1, 2, 3, 5, 8, 13, 21}, but consider some random amount, let&#8217;s say  $9824516.53 divided by that same array of weightings. The weightings have to be obeyed and the numbers  must all add up at the end. This implementation was supplied by my friend and former colleague Tim Eagles and refined a little by myself.</p>
<p>The current implementations of both the &#8216;proRate&#8217; methods take the remainder <em>R</em> and distribute it amongst the *first* <em>R</em> elements of the (weighted or un-weighted) buckets. Thus, the earliest elements may be out by 1 cent (or 1 whole Yen) compared to a straight floating point division of value divided by number of buckets.</p>
<p>If you find this library at all useful, or have improvements and suggestions, drop me a line at scot.mcphee@gmail.com</p>
<p>Please remember to shake your MoneyMaker.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v016/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Money-Is-Money v0.15 with added maven repository</title>
		<link>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/</link>
		<comments>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 06:54:17 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=322</guid>
		<description><![CDATA[In the course of an assignment for a client I&#8217;ve been giving Artifactory a good going-over. Artifactory is a Maven repository and mirror and is pretty cool and easy to set up &#8211; just drop the WAR file into a running Tomcat instance. On my Mac I ran it under Tomcat 6.0.18 with Java 5, [...]]]></description>
			<content:encoded><![CDATA[<p>In the course of an assignment for a client I&#8217;ve been giving <a title="Artifactory website" href="http://www.jfrog.org/products.php" target="_blank">Artifactory</a> a good going-over. Artifactory is a Maven repository and mirror and is pretty cool and easy to set up &#8211; just drop the WAR file into a running Tomcat instance. On my Mac I ran it under Tomcat 6.0.18 with Java 5, and on my personal Linux box (Ubuntu) I ran it with Tomcat 5.5 and Java 6. All is pretty sweet and it is fairly trivial to get Maven set up to use it. It&#8217;s just a matter of overriding the &#8216;central&#8217; repository in your <em>~/.m2/settings.xml</em> to point to you new local copy &#8211; by default it mirrors several useful repositories as well as the default one. Adding security (such as public read-only access and username/password for deployment of artefacts) takes only a few minutes on top of that.</p>
<p>In the course of all this testing though I thought it best to use it in something like real anger with the Maven release plugin rather than my rather artificial usage scenario I was building up between my two development machines.</p>
<p>As a result of all that I&#8217;ve released a version of my Monetary library, money-is-money. The version is 0.15 and the Maven repository for it can be found at <a title="Maven respoitory" href="http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local/">http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local</a></p>
<p>If you want to check the source code out with SVN out the release is at <em>http://crazymcphee.net/svn/money/tags/money-is-money-0.15</em> and the latest trunk at <em>http://crazymcphee.net/svn/money/trunk</em> (which at the time of writing is the same as the release of course, except it generates 0.16-SNAPSHOT).</p>
<p>To include it into your Maven POM you&#8217;ll have to add my respository to a profile in your settings.xml:</p>
<pre class="code" lang="xml">&lt;repositories&gt;
  &lt;repository&gt;
    &lt;id&gt;crazy-mcphee&lt;/id&gt;
    &lt;url&gt;http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local&lt;/url&gt;
    &lt;snapshots&gt;
      &lt;enabled&gt;false&lt;/enabled&gt;
    &lt;/snapshots&gt;
    &lt;releases&gt;
      &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;/releases&gt;
  &lt;/repository&gt;
&lt;/repositories&gt;</pre>
<p>At which point you can include the dependency in your pom.xml for your project:</p>
<pre class="code" lang="xml">&lt;dependency&gt;
  &lt;groupId&gt;org.autonomous&lt;/groupId&gt;
  &lt;artifactId&gt;money-is-money&lt;/artifactId&gt;
  &lt;version&gt;0.15&lt;/version&gt;
&lt;/dependency&gt;</pre>
<p>After that Maven should fetch the artifact from my repository automatically for you. Money-Is-Money is deliberately designed to void any external dependencies on anything other than Java libs, except for JUnit which only matters if you want to build from source. For more information please see <a href="http://www.crazymcphee.net/x/2009/02/11/money-is-money/" target="_self">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/04/17/money-is-money-v015-with-added-maven-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Money Is Money v 0.14</title>
		<link>http://www.crazymcphee.net/x/2009/02/11/money-is-money/</link>
		<comments>http://www.crazymcphee.net/x/2009/02/11/money-is-money/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 06:01:58 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=152</guid>
		<description><![CDATA[I&#8217;ve made a modest &#8211; very modest &#8211; library for dealing with Monetary amounts. IMHO something like this should be inside Java, to stop all those idiots using floating point logic to calculate money amounts. My library uses exactly NO EXTERNAL DEPENDENCIES apart from what&#8217;s already in Java 5 and Junit 3.8.1 for tests, which [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a modest &#8211; <em>very</em> modest &#8211; library for dealing with Monetary amounts. IMHO something like this should be inside Java, to stop all those idiots using floating point logic to calculate money amounts. My library uses exactly <em>NO EXTERNAL DEPENDENCIES</em> apart from what&#8217;s already in Java 5 and Junit 3.8.1 for tests, which were by and large, all written first. It&#8217;s release with the MIT Licence, so you can use it freely as long as you include the copyright notices.</p>
<p>It&#8217;s still a work in progress. You can check it out with SVN from <a title="Money Is Money" href="http://crazymcphee.net/svn/money/trunk/" target="_self">http://crazymcphee.net/svn/money/trunk/</a></p>
<p>From the README:</p>
<blockquote><p>This package is copyright 2008-2009 Scot Mcphee.</p>
<p>Licence is the M.I.T. Licence. Please see the file &#8220;LICENCE&#8221;.</p>
<p>WHAT IS Money-Is-Money?</p>
<p>Money-Is-Money is a library for the correct manipulation of monetary data. I wrote this small library because I found that there were not any available public source Money implementations, despite some Time-based libraries promising such (I guess Time is more interesting to programmers than filthy lucre).</p>
<p>It consists primarily of an interface, called &#8216;Money&#8217;, and a Factory for making money, called &#8216;MoneyMaker&#8217;.  There are a number of implementation classes, primarily CashMoney and  PrecisionMoney. They both share a abstract implementation, AbstractMoney. For the time being. I can see ways to eliminating both and just having a single implementation of the Money interface, but I haven&#8217;t done it yet.</p>
<p>However, for the time being, CashMoney is used whenever MoneyMaker is given a Currency (that&#8217;s java.util.Currency)  which has a default scale less than the given BigDecimal&#8217;s scale. Yes, that&#8217;s a java.math.BigDecimal. If you whine  about wanting to use doubles and floats congratulations! you are the target audience and therefore you should *really* be using this library and I won&#8217;t go into debate here why it&#8217;s wrong to use floating point logic in  Money<br />
implementations.</p>
<p>Money is designed to be an immutable object. All operations on Money, such as Money.add(Money) returns a new instance  of Money representing the added amounts. There are operations for add, subtract, divide, and multiply. The default rounding mode is HALF_EVEN or &#8216;bankers rounding&#8217;. If a value comes out to 0.5, it is rounded to the EVEN value,  so $3.555 at  a precision of 2 decimal places becomes 3.56, and so does $3.565. Divide and multiply also include methods to perform those operations with a specified rounding mode.</p>
<p>There is also a method &#8216;proRate&#8217;. This takes the existing money and divides it up into the number of buckets you  specify, with the modulo distributed in as small as increments as possible across as money of the buckets as possible. This is NOT THE SAME as dividing by the number you specify. So $10.00 divided into 3 buckets results in buckets containing $3.34, $3.33, $3.33. The specification is, adding the buckets back up should always result in the original amount without any rounding errors. You should be able to pro rate an amount, then pro rate those amounts, recursively many many times and adding up all the values will result in EXACTLY the original amount.</p>
<p>If you find this library at all useful, or have improvements and suggestions, drop me a line at scot dot mcphee at gmail dot com</p>
<p>Please remember to shake your MoneyMaker.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/02/11/money-is-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

