[Seaside] Smalltalk float to currency how to ?

Nevin Pratt nevin at bountifulbaby.com
Tue Jan 31 16:38:24 CET 2006


Michel Bany wrote:

>
>> I would like to see 12.60
>>
>> Is there simple way to do it ?
>> like fprintf in C/Perl world ?
>>
> Try this.
> (amount * 100) asInteger printStringAsCents.
>

If 'amount' is, say, 12.499999, I think 12.50 is the desirable answer.  
The above will instead yield 12.49.

Nevin



More information about the Seaside mailing list