[Seaside] Re: Smalltalk float to currency how to ?

David T. Lewis lewis at mail.msen.com
Thu Feb 2 01:44:26 CET 2006


in Wed, Feb 01, 2006 at 02:51:42PM +0300, Dmitry Dorofeev wrote:
> Thanks,
> 
> this one looks practical.
> I am sad there is no Money in Squeak though...

Don't be sad, there is ScaledDecimal in Squeak :)

Float is *not* appropriate for financial calculations, but
ScaledDecimal should be OK. And #printShowingDecimalPlaces: will
work with ScaledDecimal also:

123.3453 asScaledDecimal printShowingDecimalPlaces: 2. ==> '123.35'

Dave



More information about the Seaside mailing list