[Newbies] Number formatting printf/sprintf for Squeak?

Chris Cunningham cunningham.cb at gmail.com
Wed Feb 18 19:28:29 UTC 2009


I'd be leary of basing Currency off of ScaledDecimal, especially if there is
to be much manipulation of it (such as multiplication or division).  The
reason is that ScaledDecimal keeps the representation of their numbers as
fractions under the covers - which can results in some odd (and incorrect)
results.

There is another package (not part of standard Squeak) that could be more
suitable as a basis for Currency: FixedDecimal, located at
http://www.squeaksource.com/FixedDecimal .  The code isn't very pretty
(sorry about that), but it does work for currency.  That is the reason it
was originally written - when I started noticing the results of simple
mamipulation of my money amounts where wrong.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20090218/cd9b81d9/attachment.htm


More information about the Beginners mailing list