Any help would be greatly appreciated. I am adding JavaScript fields with a onChange command with decimals but when the onChange command is moved back to option "NO" to remove the number (example. 1.7) it only removes 1.69999 and not the 1.7.
Below is the onChange code I am using.
<div id="onewindow">
<label for="txtoneside" class="editor-label"><strong>1 Side </strong></label>
<div align="right">
<input type = "text" name = "txtoneside" id="txtoneside" value = "1.7" />
<select name="txtoneside_slider" id="txtoneside_slider" data-role="slider" data-mini="true" onChange="javascript: if(this.value=='yes'){ document.getElementById('txtgrandtotal').value= parseFloat(document.getElementById('txtgrandtotal').value) + parseFloat(document.getElementById('txtoneside').value); calculate()}
if(this.value=='no'){ document.getElementById('txtgrandtotal').value= parseFloat(document.getElementById('txtgrandtotal').value) - parseFloat(document.getElementById('txtoneside').value); calculate()}"/>
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
<div id="twowindow">
<label for="txtoneside" class="editor-label"><strong>2 Side </strong></label>
<div align="right">
<input type = "text" name = "txttwoside" id="txttwoside" value = "19.3" />
<select name="txttwoside_slider" id="txttwoside_slider" data-role="slider" data-mini="true" onChange="javascript: if(this.value=='yes'){ document.getElementById('txtgrandtotal').value= parseFloat(document.getElementById('txtgrandtotal').value) + parseFloat(document.getElementById('txttwoside').value); calculate()}
if(this.value=='no'){ document.getElementById('txtgrandtotal').value= parseFloat(document.getElementById('txtgrandtotal').value) - parseFloat(document.getElementById('txttwoside').value); calculate()}" />
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
</div>
<div id="grandtotal">
<label for="txtgrandtotal" class="editor-label"><strong>JOB TOTAL</strong></label>
<div align="right">
<input type = "text" name = "txtgrandtotal" id="txtgrandtotal" value = "0" />
</div>
</div>