I have run into a problem and I can't figure out what's happening or why this script won't work. I am a self-taught scripter and only know what I use really. Any help would be appreciated. OK, here's the problem:
I have a total of 5 dollar fields that will be calculated into a 6th dollar field. An example of what I need is like -------- field1 + field2 + field3 + field4 * field5. The answer to all of that gets put into the 6th field, which will also need to be rounded to the nearest whole $. The only thing I want rounded is the answer, not the individual fields themselves. Also, one thing that I know for sure is wrong (and something I don't know how to do) is the fact that all the fields are optional. Meaning, maybe there will be input in them, and maybe there won't. I just have no idea how to script that. Here's what I've got that isn't working--------------
Expand|Select|Wrap|Line Numbers
- var a = this.getField("LO");
- var b = this.getField("PP");
- var c = this.getField("AEC");
- var d = this.getField("UM");
- var e = this.getField("TOT");
- event.value = Math.round(a.value+b.value+c.value+d.value*e.value);