Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    There's a syntax error in your code, last if is missing, jsfiddle.net/xFHte/2 Commented Jun 27, 2013 at 13:53
  • Not the problem, but may I suggest a minor optimisation/tidy-up: avoid repeated parseFloat() calls by adding var val = parseFloat(this.value) at the beginning of your function and then in each if just test val... Commented Jun 27, 2013 at 13:55
  • Maybe I missed it, but what exactly is the problem. What number does it fail on. What do you input and what is the problematic output. You have all these magic numbers, I'm not understanding this. Commented Jun 27, 2013 at 13:57