I have the following code in a bind value on a form (see below),
the problem I have is some of the values can be zero (2-5) which results in an error due to it dividing by zero, I need to be able to check them and if they are zero run a different calculation to exclude them.
Could anyone please point me in the right direction.
dmx-bind:value="(((inp_Income1Amount.value.toNumber() / inp_Income1PaymentSchedule.value.toNumber()) + (inp_Income2Amount.value.toNumber() / (inp_Income2PaymentSchedule.value.toNumber()) + (inp_Income3Amount.value.toNumber() / inp_Income3PaymentSchedule.value.toNumber()) + (inp_Income4Amount.value.toNumber() / inp_Income4PaymentSchedule.value.toNumber()) + (inp_Income5Amount.value.toNumber() / inp_Income5PaymentSchedule.value.toNumber()))) * 30)"