If/else Statement Calculation
I have been working on this for hours now and keep having an issue. I am semi-new to JavaScript but Google has been less than helpful in helping me figure out this JS.
Basically I created a function in Excel a couple years ago and now need to convert this to calculate it in a pdf.
This is my Excel calculation: =IF(B4<500,1,IF(B4=500,1,IF(B4=1000,2,IF(B4>1000,(B4*0.2%),2))))
So far in Adobe I have gotten this and I have no clue if I'm semi-correct or heading in the right direction or what:
var amount = this.getField("amount").value
var z = this.getField("amount") * 0.002;
if (amount <= 500) {event.value = "1.00"}
else if (amount > 500 & <= 1000) {event.value = "2.00"}
else {event.value = z}
I keep getting this error "SyntaxError: invalid XML name 4; at line 5"
Can anyone help me with this? I've been Google-ing for hours and asked my brother, but he hasn't programmed in 10 years.
