help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] asString for Floats?


From: J Pfersich
Subject: [Help-smalltalk] asString for Floats?
Date: Tue, 31 Oct 2006 00:10:42 -0700

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]