Jump to content

Javascript Calculator


graphxwill

Recommended Posts

Hi, I am building some javascript calculators that must calculate according to an excel doc with formulas ; ie, (it must have same answers as excel sheet). I am fairly new at javascript but have gotten pretty far. The problem that im having is that the answers that my javscript calculators are producing arent exactly the same as the Excel formulas.

 

(but very close)

 

Example:

Javascript Calculator- https://wzsdesign.com/WebTemplWP1/cal6.html

 

Excel Formulas-

Screen-Shot-2014-01-23-at-3.24.32-PM.png

 

 

 

 

Screen-Shot-2014-01-23-at-3.24.53-PM.png

 

If you take a look at the link with the javascript calculator and input the same numbers as the screen shot you will notice that there a small differences in the answers. Can someone please help?

 

 

Link to comment
Share on other sites

Your issue it seems in in cell G91. Whatever formula you have there is rounding your number up to what appears to be the nearest whole number. Whereas your javascript formula rounds down. Otherwise the values are all the same when an "output" is required. That leaves G91 being the only difference. I could be wrong, but I'd start there and see if there's a discrepancy between the two formulas.

 

What are you using to convert the excel to javascript?

Edited by jscriptnoob
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...