Magritte MANumberDescription and ScaledDecimal numbers

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

Magritte MANumberDescription and ScaledDecimal numbers

GMailAccount
I'm having a little trouble with MANumberDescription, because it keeps
internalizing the numbers as ScaledDecimals, and for whatever reason,
ScaledDecimals print out like this:

0.05s2  0.0s1   15s0
0.05s2  0.07s2  44.0s1

etc.

This is really going to boggle the users minds, and I know I'll get  
asked
weekly: 'What are the S's for on those numbers?'.

So ideally, I'd like MANumberDescription to treat the numbers as Floats.
Alternatively can the rendering methods for MANumberDescription can be
overridden, to preform the necessary display conversion  
automatically? Or is it
best to directly modify the ScaledDecimal class to print the way I'd  
like?

Cheers,
Warren Wilkinson
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Magritte MANumberDescription and ScaledDecimal numbers

Philippe Marschall
2007/7/26, GMailAccount <[hidden email]>:

> I'm having a little trouble with MANumberDescription, because it keeps
> internalizing the numbers as ScaledDecimals, and for whatever reason,
> ScaledDecimals print out like this:
>
> 0.05s2  0.0s1   15s0
> 0.05s2  0.07s2  44.0s1
>
> etc.
>
> This is really going to boggle the users minds, and I know I'll get
> asked
> weekly: 'What are the S's for on those numbers?'.

Standard Smalltalk scaled decimal syntax.

> So ideally, I'd like MANumberDescription to treat the numbers as Floats.

No, please not.

> Alternatively can the rendering methods for MANumberDescription can be
> overridden, to preform the necessary display conversion
> automatically?

Sure, write your own string readers and writers. But you might also
want to create your own ScaledDecimal description while you're at it.

> Or is it
> best to directly modify the ScaledDecimal class to print the way I'd
> like?

 That's pretty much the worst option, this is begging for problems.

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside