5.3 printShowingDecimalPlaces: 2 displays '5.29' instead
ssastre at seaswork.com
Thu Nov 22 19:00:05 UTC 2007
may be I should clarify that it's only for presentation. The mone value
is stored as anMeasure of it's monetary unit in the Aconcagua framework.
But I'm curious about your answer. Let's supose the user enters in some
input widget with keyboard the '5.30' value. That will end as a Float at
some point. Do you suggest I convert that to a ScaledDecimal? (to
I'm evaluating this:
(5.3 asScaledDecimal: 2)
and also obtainig: ' 5.29s2'
so I'm still lost about it,
De: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] En nombre de tim
Enviado el: Jueves, 22 de Noviembre de 2007 16:18
Para: The general-purpose Squeak developers list
Asunto: Re: 5.3 printShowingDecimalPlaces: 2 displays '5.29' instead
On 22-Nov-07, at 10:03 AM, Sebastian Sastre wrote:
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 Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: FSRA: Forms Skip and Run-Away
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev