Cancerbero sgurin@montevideo.com.uy wrote:
My situation is this: The user's input is a String representing a floating point number, so I want something that converts a String representing a floating point number to a Float. Example: Something like String>>asFloat so '3.14' asFloat returns the Float 3.14.
So my suggesiont is to add a method String>>asFloat. For example:
That's a nice method to have around, but it should be implemented by using the same code that is already present for reading floats. That code can be used like this:
Float readFromString: '3.14'
The thing is, it would be nice if asFloat does *exactly* the same thing as "Float readFromString:", and if future tweaks to either one also take effect on the other.
-Lex