What am I doing
I have a picture framing calculator which caters to calculating the appropriate 
The Problem
I am trying to alter my equations to include my input and the drop down selection. I updated both equations with how I think it should go, but now receive the error NaN NaN/1. However, this is an image of the result when I attempt the new equations and I try to utilize the drop down menu.:
The Mat Overlap drop down menu works, but the incorporation of the drop down menus which correspond with the Frame Width, Frame Height, Picture Width, and Picture Height are creating the error I believe. I can't figure what I'm missing.
What I've tried
I've tried the following equations:
var width = (1/2)*(hf hpf-hp hpf o);andvar height = (1/2)*(wf wff-wp wpf o);var width = (1/2)*((hf hpf)-(hp hpf) o);andvar width = (1/2)*((wf wff)-(wp wpf) o);
CodePudding user response:
Thank you
Hello, the Map Overlap is using parseFloat while the others is using parseInt. If you want to use parseInt you need to specify 0 in front the decimal parseInt(0.0625). Otherwise it will become Nan. – fatin amirah
you need to change string to the interger or float by using parseFloat and parseInt I have added the solution for this.
This was two topics that came together.
This discussion concerned placing the mathematics together for the equations. By change string to the interger or float by using parseFloat and parseInt I have added the solution. All variables were declared & added to the equation. Solution is available on above link on #1
This question addressed how the change affected the replacement, newer equations. As they simply would not work.
The Solution To This Problem
Changing all drop down numbers to have a
0in front of the decimal. For example,0.0became0,.75became0.75.And completely removed all instances of the following:
<option value="none" selected="selected"> -- choose one --</option>This has eliminated the 'NaN' issue.
The final Fiddle can be found here: https://jsfiddle.net/1rcmoj9x/1/

