zalipresents Posted September 13, 2015 Report Share Posted September 13, 2015 Please help...i'm using the below script in a details page to calculate "Show Gross" and the formula is not calculating any numbers past the decimals. I've tried changing the "total" to "total.toFixed(2)" in a variety of ways and it didn't help...also tried adding in ".toPrecision()" and it didn't work. I can get the end cell to have 2 spaces with ".toFixed(2)", however the calculation does not calculate anything past the decimal. Didn't realize this was an issue till just now & I am in a bind...please help:) It feels like I need to tell the formula to calculate the numbers past the decimals, however I'm not sure on how to do that. <SCRIPT LANGUAGE="JavaScript"> function calculate() { var Settle_ADV_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)))?0:(parseInt(document.getElementById("EditRecordSettle_ADV_Gross").value)); var Settle_DOS_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_DOS_Gross").value)))?0:(parseInt(document.getElementById("EditRecordSettle_DOS_Gross").value)); var Settle_Walk_Up_Gross = isNaN((parseInt(document.getElementById("EditRecordSettle_Walk_Up_Gross").value)))?0:(parseInt(document.getElementById("EditRecordSettle_Walk_Up_Gross").value)); var total= Settle_Walk_Up_Gross + Settle_DOS_Gross + Settle_ADV_Gross; document.getElementById("mypage").innerHTML=' $'+total ; document.getElementById("EditRecordSettle_Show_Gross").value=total ; } document.getElementById("EditRecordSettle_Walk_Up_Gross").onchange=calculate; document.getElementById("EditRecordSettle_DOS_Gross").onchange=calculate; document.getElementById("EditRecordSettle_ADV_Gross").onchange=calculate; calculate(); </SCRIPT> </span></strong> Quote Link to comment Share on other sites More sharing options...
iren Posted September 14, 2015 Report Share Posted September 14, 2015 Hello zalipresents, I would recommend you to use calculated field: IsNull([@field:Settle_Walk_Up_Gross],0)+IsNull([@field:Settle_DOS_Gross],0)+IsNull([@field:Settle_ADV_Gross],0) and choose the format of results of your calculated field. Hope it helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.