Problems with Floats

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with Floats

Ana Laura
Hi!!!!

I'm having a little problems with floats.
When I evaluate the following:
Number fromString: '3.14'
the result is an instance of Float: 3.14.0

Am I doing something wrong?
Thanks, Ana Laura.

PS: I'm using Dolphin 5.0


Reply | Threaded
Open this post in threaded view
|

Re: Problems with Floats

Osvaldo Aufiero
You are having a problem with your regional settings. Put decimal symbol: ,
and it works.
best regards,

Osvaldo

"Ana Laura" <[hidden email]> wrote in message
news:[hidden email]...

> Hi!!!!
>
> I'm having a little problems with floats.
> When I evaluate the following:
> Number fromString: '3.14'
> the result is an instance of Float: 3.14.0
>
> Am I doing something wrong?
> Thanks, Ana Laura.
>
> PS: I'm using Dolphin 5.0
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Problems with Floats

Christopher J. Demers
In reply to this post by Ana Laura
Ana Laura <[hidden email]> wrote in message
news:[hidden email]...
>
> I'm having a little problems with floats.
> When I evaluate the following:
> Number fromString: '3.14'
> the result is an instance of Float: 3.14.0

I can not reproduce this in my D5 image.  This is just a guess, but is it
possible that you have your system use a comma (,) rather than a period (.)
for the decimal character?  It looks like Dolphin is taking that into
account, however perhaps you changed your locale while Dolphin was running?
It looks like it caches the decimal value, so it might be able to be out of
sync with the system if you change locales.  The interesting method are
Float<<printOn:significantFigures: and CRTLibrary<<decimalSeparator.  I
don't really work with different locales, so perhaps someone else knows if
this is a bug or a feature.

Not to go too far off topic, but does anyone know why different cultures use
different decimal separator characters?  Is there a historical basis for
this?

Chris