Adobe position paper on the ECMAScript 4 proposal space -- decimal

Brendan Eich brendan at
Mon Mar 3 09:22:45 PST 2008

On Mar 3, 2008, at 7:25 AM, Mike Cowlishaw wrote:

> "Igor Bukanov" <igor at> wrote on 03/03/2008 14:39:32:
>> On 27/02/2008, Brendan Eich <brendan at> wrote:
>> ...
>>> I agree with what Lars wrote, except here I think the value of a
>>>  hypothetical (possibly mythical) "big red switch" is understated.
>> ...
>>> The common problem is that you can't do "dollars
>>>  and cents" or "pounds and pennies" arithmetic and get the "right
>>>  answer":
>>>  js> 74.96-39.96
>>>  34.99999999999999
>> The problem here is not the binary float arithmetics but rather the
>> conversion of numbers into strings. If a global switch would exist
>> that would make a default toString conversion to use  a particular
>> version of toFixed, the problem would disappear for most user cases.

ES3 added Number.prototype.toFixed and a few others. They are not  
enough as Mike says, and practically no one knows to use them.

> That's unfortunately not true.  Not only is the required toFixed  
> number
> unpredictable in many applications, but it may give the wrong  
> answer even
> when known.  See item 2 at:
> (This particular problem is systematic, and it adds up to around  
> $2M for a
> medium-sized telco.  That misplaced $2M is cheating either the
> shareholders, the customers, or the taxman.  None of those options  
> look
> good in a newspaper report :-).)

Office Space ;-)

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Es4-discuss mailing list