Hi All,
I am working on a custom shopping basket, and using Template to multiple
the quantity of each item by its base price, and then also summing it.
But I'm losing the floating points. It's coming out as flat INTs.
Any idea of how to fix this?
Thanks in advance.
--Alex
Nevermind... Sorry... Turned out to be a JS problem actually parseInt
vs parseFloat
Ugh.
On Thu, Jan 10, 2013 at 4:06 PM, Alex Brelsfoard
wrote:
> Hi All,
>
> I am working on a custom shopping basket, and using Template to multiple
> the quantity of each item by its base price, and then
Hi Alex,
On Thu, 10 Jan 2013 16:17:06 +
Alex Brelsfoard wrote:
> Nevermind... Sorry... Turned out to be a JS problem actually parseInt
> vs parseFloat
>
> Ugh.
>
>
> On Thu, Jan 10, 2013 at 4:06 PM, Alex Brelsfoard
> wrote:
>
> > Hi All,
> >
> > I am working on a custom shopping
Thanks Shlomi,
My boss told me not to worry about different currencies yet. He's pushing
to get the site up asap with the bare necessities.
I actually have some similar custom code that I'll be using later when I
get more time to implement it (not my first time dealing with international
currenci
Even in just US Dollars, Floats are bad for money. E.g., if you get involved
with sales tax, you're better off calculating in Pennies and sprinf'ing the $ .
in, you don't want .001 issues.
Exceptions to this rule require very careful analysis.
- Bill aka n1vux
NOT SPEAKING FOR $DAYJOB
Others have already said as much, but this is one of those issues that can
withstand overstatement.
When a programmer is asked to "write a program to do something", they need
to not simply map the superficialities of the activity onto the
superficialities of how computers operate. It is essential
6 matches
Mail list logo