Page 1 of 1

Calculation using an editbox

Posted: Wed Jan 08, 2025 4:16 pm
by sbinns@ifguk.com
Hi

I have three editboxes, the third of which is a calculation of the inputted values of 1 & 2

That part works fine, however i want the result to be rounded up to a whole number as currently the decimal places run to infinite

Javscript does this using the script Math.round(x)

I have set a chnage event for Editbox 3 to run that Javascript, but it doesn't

Can anyone help please

Re: Calculation using an editbox

Posted: Wed Jan 08, 2025 4:32 pm
by Pablo
You cannot round the value within an onchange event because updating the value during the event will trigger another onchange event, potentially causing an infinite loop.
You will need to round the value in the calculation itself.