[Boston.pm] Template toolkit and floats

2013-01-10 Thread Alex Brelsfoard
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

Re: [Boston.pm] Template toolkit and floats

2013-01-10 Thread Alex Brelsfoard
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

Re: [Boston.pm] Template toolkit and floats

2013-01-10 Thread Shlomi Fish
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

Re: [Boston.pm] Template toolkit and floats

2013-01-10 Thread Alex Brelsfoard
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

Re: [Boston.pm] Template toolkit and floats

2013-01-10 Thread Ricker, William
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

Re: [Boston.pm] Template toolkit and floats

2013-01-10 Thread John Redford
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