SRL Archive - Web Development

What's wrong with this?


Kyle Undefined

2012-07-20 11:52:30

Ok, so I'm building a calculator for one of our products. I got it all working and built a generic function since there will be more of these to built down the road.

The function I wrote is pretty sexy, if I do say so myself. I'm just having one issue with it. When I change the code to show decimals, it messes up the whole functionality. I have the code that messes up commented out for now, so you'll see it when you look at the file.

Open the attached file in your browser and see how it functions, then uncomment out the code that I have and run it again, you'll see what I'm talking about.

I believe the issue is in the setInterval function, but for the life of me I can't figure it out. This isn't a show stopping issue, since it works with whole numbers, I just want this to be exact as possible.

Any help would be greatly appreciated!

P.S. only the first three calculators are working at this time. The two on the first "page" and the one on "page" 2.

Hazzah

2012-07-21 14:22:05

Second calculator on the first page does not work for me (firefox)
http://puu.sh/Kuj0

shstiger2009

2012-07-21 17:58:27

Ahh, a calculator for downsizing a company. That sucks.

Not the idea, it's a good way to see how much is being wasted, just sucks that you're having to do that. :(

Kyle Undefined

2012-07-22 04:26:00

From: Hazzah
Second calculator on the first page does not work for me (firefox)
http://puu.sh/Kuj0


There's no validation as of yet, but all the calculators are fully functional. The reason it's not working is because you left the last two blank. :p

From: shstiger2009
Ahh, a calculator for downsizing a company. That sucks.

Not the idea, it's a good way to see how much is being wasted, just sucks that you're having to do that. :(


It's not for downsizing a company, but to better organize it and make sure time isn't being wasted :)

Frement

2012-07-22 04:40:57

I don't know what your problem really is, but check the input for "," and replace it with "." before doing any calculating.

EDIT: That is the only problem I really see, everything else seems to be working :|

Hazzah

2012-07-23 03:51:46

From: Kyle Undefined
There's no validation as of yet, but all the calculators are fully functional. The reason it's not working is because you left the last two blank. :p


Good try, but I did try filling in the last two, and it still returned NaN as a result. Other than that, I will take your word that they work :P

Kyle Undefined

2012-07-23 08:31:54

Yeah, I'm still stumped by this issue. Haven't looked at it all weekend, so I might be able to spot the issue.