you should do that... one thing is how your model works and another is how it shows the results to a human (display, printer, etc)... so if you have a number renderer or something like that, you do asFloat there... but that is not enough, you will have to decide how many decimals you want to show, etc. so it is better to use #printShowingDecimalPlaces: and problem solved :-)

On Sat, Jul 31, 2010 at 4:54 PM, Stanislav Paskalev <kshorg@gmail.com> wrote:
Purely for display. I'm doing a very basic accounting app that does
not need full accuracy, but saying that the client should pay (X/Y)
amount of cash .. that will be a problem :)

In the end, I might as well keep fractions for the model itself, and
just add asFloat on the view wherever required.

On Sat, Jul 31, 2010 at 10:41 PM, St�phane Ducasse
>> That's the way I'm doing it now, but it's redundant to put asFloat at
>> the end of each division. There *should* be a more elegant way, at
>> least I hope so :)
>
> why?
> I do not like to manipulate float when I can have exact math operations.
> So I put asFloat exactly when I know I want to leave the math world to end up in the computer science world.
>
> Why do you need float and not fraction?
> You crunch matrix resolution with large numbers?
>
> Stef
>
>
> _______________________________________________
> Pharo-users mailing list
> Pharo-users@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>

_______________________________________________
Pharo-users mailing list
Pharo-users@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users



--
Hern�n Wilkinson
Agile Software Development, Teaching & Coaching
Mobile: +54 - 11 - 4470 - 7207
email: hernan.wilkinson@10Pines.com
site:�http://www.10Pines.com