5.3 printShowingDecimalPlaces: 2 displays '5.29' instead of '5.30'

nicolas cellier ncellier at ifrance.com
Thu Nov 22 18:51:12 UTC 2007


I can only agree and add "use ScaledDecimal".
5.3s2

Beware, Squeak::ScaledDecimal does truncate rather than round when 
printing... (http://bugs.squeak.org/view.php?id=5693)
You might have to change this behavior...

Also beware of storeOn: (very minor, who is using storeOn:?).

Nicolas


tim Rowledge a écrit :
> 
> On 22-Nov-07, at 10:03 AM, Sebastian Sastre wrote:
> 
>> Hi there,
>>  
>>     I'm geting this unexpected result from a Squeak 3.9 final 7067 image.
>>  
>>     I need to display money values with two digits. Has anybody a 
>> sugestion to correctly achieve this?
> 
> First and most important - don't maintain money as floating point numbers.
> Second - never do simple compares of floating point numbers.
> 
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: FSRA: Forms Skip and Run-Away
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 




More information about the Squeak-dev mailing list