James Foster wrote:
> Adding a '0' to the beginning of the string fixes the error.
>
> String>>asNumber
> "Handle '.5' as a number"
>
> ^Number fromString: '0' , self
This reminds me that some time ago I achieved a similar result by making
a tweak to the Number class>>readSmalltalkSyntaxFrom: method. There's
something to be said for making the change at the lower level. For
instance Number>>readFrom: can also be used to read numbers in the ".5"
format.
This came up for me a couple of years ago when reading files that had
been creating using VisualBasic. Seems that VB's default in printing
floating point numbers between 0 and 1 was to leave off the '0' from in
front of the decimal point.
I wonder if allowing this number format is something that Object Arts
should incorporate into the base image?
-------------------------------------------
Bill Dargel
[hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105 USA