just a kick comment.<br>We use Fraction, no ScaledDecimal, no Float. We made some changes to fraction to work faster. We didn't see big performance diferences with ScaledDecimal.<br>We use measures to represent all type of quantities of some financial instrument. For example:
<br>100 dollars<br>100 IBM<br>100 bond (any bond)<br>etc.<br><br>Bye,<br>Hernan.<br><br><div class="gmail_quote">On Nov 22, 2007 5:50 PM, Sebastian Sastre <<a href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</a>
> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> -----Mensaje original-----<br><div class="Ih2E3d">> De: <a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org">
squeak-dev-bounces@lists.squeakfoundation.org</a><br>> [mailto:<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org">squeak-dev-bounces@lists.squeakfoundation.org</a>] En<br></div>> nombre de Tom Phoenix<br>
> Enviado el: Jueves, 22 de Noviembre de 2007 17:59<br><div class="Ih2E3d">> Para: The general-purpose Squeak developers list<br>> Asunto: Re: 5.3 printShowingDecimalPlaces: 2 displays '5.29'<br>> insteadof'
5.30'<br>><br></div><div class="Ih2E3d">> On 11/22/07, Sebastian Sastre <<a href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</a>> wrote:<br>><br>> > Let's supose the user enters in some
<br>> > input widget with keyboard the '5.30' value. That will end<br>> as a Float<br>> > at some point.<br>><br>> Why will it?<br>><br>> We're talking about monetary units. If you start with a
<br>> string like '5.30', meaning 530 monetary units, it won't "end<br>> as a Float" all by itself. If somebody somewhere wrote code<br>> that converted it to floating point, that's a bug.
<br>><br></div>Even if you don't use computers to achieve that, when you make monetary<br>values to pass trhough functions they *are* mathematically represented as<br>float numeric values. At some point we simplify presentations (like the
<br>balance books you mention) of the values.<br>I certainly agree with you about units. In fact there are equivalence units.<br>100 cents are 1 dollar, 4 quarters also are equal to 1 dollar and 100 cents.<br><br>Aconcagua framework seems to deal quite well with that trough it's Measures
<br>(and amount and a unit). For monetary measures I think I'll store scaled<br>decimal amounts to gain the accuracy you propose.<br><div class="Ih2E3d"><br>> Don't be misled by what looks like a decimal point. If you're
<br>> working with money, you don't want floating point, no matter<br>> what your programming language. Floating point will lose tiny<br>> bits due to roundoff; but money numbers are almost always<br>> integral numbers of cents, and you don't want to lose any of
<br>> them. Floating point may be needed to perform some<br>> calculations along the way, but you'll use integers to get<br>> the books to balance.<br>><br></div>I agree. With measures I think I'll be able to achieve that, by using scaled
<br>decimanls in the amounts of the measures, and the rounding will be performed<br>only in presentation time by the converter of the widget and not in the<br>internal process, formulas or calculation of the value.<br><br>
Cheers!<br><font color="#888888"><br>Sebastian<br></font><div><div></div><div class="Wj3C7c"><br><br>> ObSqueak: 5.30 asFraction<br>><br>> Cheers!<br>><br>> --Tom Phoenix<br>><br><br><br></div></div></blockquote>
</div><br>