[Newbies] Number formatting printf/sprintf for Squeak?
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)
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners