List Info

Thread: asString for Floats?




asString for Floats?
user name
2006-10-31 07:10:42
I'm confused. When I work with Magnitudes there are odd
inconsistencies.
I try to convert Characters and Floats to Strings to print
them out,
I use different methods to get the results I expect. See
below for a sample.

st> var asString !
Object: 89910996357705.5 error: did not understand #asString
MessageNotUnderstood(Exception)>>#signal
FloatD(Object)>>#doesNotUnderstand:
UndefinedObject>>#executeStatements
nil
st> var printString !
'89910996357705.5'
st> $r asString !
'r'
st> $r printString !
'$r'

For the Character, asString gives me the representation I'm
looking for,
whereas the Float only has printString available. Shouldn't
there be
a asString method available for Floats?

BTW, I'm putting together a document of GNU Smalltalk for
newbies.



_______________________________________________
help-smalltalk mailing list
help-smalltalkgnu.org

http://lists.gnu.org/mailman/listinfo/help-smalltalk
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )