Skip to main content
Known Participant
October 18, 2019
Beantwortet

If/else help needed please *solved*

  • October 18, 2019
  • 2 Antworten
  • 839 Ansichten

I've tried to do this myself, but I'm missing something as it doesn't work! Could someone correct me please

 

Basically, if the VatValue.3 field says 'Exempt', the aVATRate.3 field should say 0, but if the field shows a percentage value (eg 20%), them it should show the value divided by 100.

 

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = .value/ 100.0;
}

 

 

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von Bernd Alheit

Try this:

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = this.getField("VatValue.3").value/ 100.0;
}

2 Antworten

Bernd Alheit
Community Expert
Community Expert
October 18, 2019

Try this:

if (this.getField("VatValue.3").value == "Exempt") {
event.value = 0;
}
else {
event.value = this.getField("VatValue.3").value/ 100.0;
}
jlehaneAutor
Known Participant
October 18, 2019

Perfect! Thank you Bernd - much appreciated 🙂