[Seaside] Money ScaledDecimal is it really *appropriate* ?

Cees De Groot cdegroot at gmail.com
Fri Feb 3 15:15:51 CET 2006


On 2/3/06, Dmitry Dorofeev <dima-sender-3c337a at yasp.com> wrote:
> Ok, here is the situation: I need currency support in Seaside or Squeak.

Make a class Currency and a class Amount. Currency has:
- description ("US Dollars")
- ISO currency code ("USD")
- common currency code ("$" or "US$")
- code to print amounts.
- number of decimals, if any.

Amount has:
- a ScaledDecimal
- a Currency
- print code will be dispatched to Currency.

Bonus points for constructor methods in Number so you can write '12 dollars'.
Double bonus points for hooking up to xe.com or similar so you can
write '(12 dollars + 23 pounds) asEuros'.
And finally triple bonus points for making amounts and currency
conversions date-aware (I think I have some pointers to time travel
patters in my blog).

Note that this quickly gets hairy and application specific. That, plus
the fact that Squeak is not primarily a business-oriented development
environment, is probably the cause that there's no standard package
for this stuff.

Of course, by the time you're done, we'll welcome your publishing this
on SqueakMap :)


More information about the Seaside mailing list