[Seaside] Money ScaledDecimal is it really *appropriate* ?
dima-sender-3c337a at yasp.com
Fri Feb 3 10:25:48 CET 2006
I just wondering can I use
Money amount: 15.89 currency: '£'
to use with HTML rendering (same applies to Euro sign)
or do we need just different method to rendering HTML friendly
version of currency symbols based on name of currency ?
like Dictionary with
'USD' -> $
'GBP' -> '£'
'EUR' -> '€'
Avi Bryant wrote:
> On Feb 2, 2006, at 9:29 AM, David Shaffer wrote:
>> I'd like to second what I believe Colin said about using integers to
>> represent money. If you need four digits then that dictates the scale
>> of your integers. Maybe ScaledDecimals would do the job, don't know
>> anything about them, but my experience dictates that it only takes 10
>> minutes to put together a Money (and/or Currency) class based on this
>> integer representation and it is well worth the effort. Attached is one
>> that I've used in the past...maybe not as robust as you need but you
>> could probably hack it into your 4-digit form faster than you could
>> learn about ScaledDecimal...
>> Maybe somewants to post a more industry hardened version :-)
> I wouldn't call it industry hardened, but I've posted what we use in
> Dabble to http://squeaksource.com/Money . It uses the MoneyBag
> approach to dealing with currency that I remember seeing as a pattern
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the Seaside