samadhiweb

smalltalk programming for the web



Show Me The Money

28 August 2016

I wrote a money class on Pharo 1.x a few years back. Didn't use it beyond simple calculations as my financial computing needs are met using a spreadsheet-and-wiki combo. I've now reached the limits of that approach so looking to restart my business/finance-oriented programming with Pharo.

Here are other money-related implementations for Pharo/Squeak that I found:

Money - "The money package from Squeaksource. Originally from Smalltalk Best Practice Patterns." Most recent commit in Apr 2016. Installs cleanly on Pharo 5. 10 of 11 tests pass. The failed test looks like a minor bug. Older versions exist on Squeaksource.

Aconcagua-Money - "Aconcagua units for common domains - Time, Money, and Weight at the time of this writing." Most recent commit in May 2015. Installs cleanly on Pharo 5 with Aconcagua already installed. Has no test. Presumably relies on Aconcagua's own tests, as the classes are small and look simple.

FixedDecimal - "A FixedDecimal is similar to a ScaledDecimal, but different in certain select ways. It's (sic) primary purpose was to be able to represent precise decimals for such things as representing money - where ScaledDecimals leave something to be desired. [...] Forked from http://www.squeaksource.com/FixedDecimal.html Credits to Chris Cunningham." Most recent commit in Dec 2013. 11 of 12 tests pass. My money class uses FixedDecimal.

ScaledDecimal - Part of the image.

SmallPOS - "Framework for fast building of accounting, trading (including Points of Service), CRM and so on software. Based on GLORP, Magritte and Seaside." Contains a class CMACurrency.

Money Talk

From Kent Beck, here, "Re: Money in particular, I have implemented this one five times. The only intersection of the five implementations is a Money object whose amount is some kind of number, and which has a currency. Everything else is different. [...] Therefore, I carry around in my head a pattern language for creating Money and I reimplement it every time from scratch."