List Info

Thread: twoDigitFloat bug




twoDigitFloat bug
country flaguser name
United States
2007-10-08 20:10:34
Hey guys,

I'm running into something that looks like a floating point
problem,
but I'm not sure about what can be done about it.

The thing is: twoDigitFloat(568.80) returns
"568.79". Just tested
against the trunk, too.

I've created a ticket in case anyone comes with a solution:
http://trac.mochi
kit.com/ticket/275

Thanks,
Pedro


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: twoDigitFloat bug
user name
2007-10-09 00:41:25
That's how floats work, 568.80 is represented internally as
(roughly)
567.7999. numberFormatter rounds though, you can use
numberFormatter("#.##")(568.80) which should give
you what you want.

On 10/8/07, Pedro Belo <pedrobelogmail.com> wrote:
>
> Hey guys,
>
> I'm running into something that looks like a floating
point problem,
> but I'm not sure about what can be done about it.
>
> The thing is: twoDigitFloat(568.80) returns
"568.79". Just tested
> against the trunk, too.
>
> I've created a ticket in case anyone comes with a
solution:
> http://trac.mochi
kit.com/ticket/275
>
> Thanks,
> Pedro
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: twoDigitFloat bug
country flaguser name
United States
2007-10-09 15:06:10
Great, thanks Bob.

On Oct 8, 10:41 pm, "Bob Ippolito" <b...redivi.com> wrote:
> That's how floats work, 568.80 is represented
internally as (roughly)
> 567.7999. numberFormatter rounds though, you can use
> numberFormatter("#.##")(568.80) which should
give you what you want.
>
> On 10/8/07, Pedro Belo <pedrob...gmail.com> wrote:
>
>
>
> > Hey guys,
>
> > I'm running into something that looks like a
floating point problem,
> > but I'm not sure about what can be done about it.
>
> > The thing is: twoDigitFloat(568.80) returns
"568.79". Just tested
> > against the trunk, too.
>
> > I've created a ticket in case anyone comes with a
solution:
> >http://trac.mochi
kit.com/ticket/275
>
> > Thanks,
> > Pedro


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "MochiKit" group.
To post to this group, send email to mochikitgooglegroups.com
To unsubscribe from this group, send email to
mochikit-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )