Oops on the Math.floor script missed something important
Hi all,
You helped me tremendously with this script earlier, but I found one error I made I have to halve the first field and use the mathfloor here before continuing operations. I thought it was an easy fix and may be, but I am missing it. This is the change I made.
event.value = Math.floor(Number(this.getField("g1p1resources").valueAsString) * 0.5 * Number(this.getField("g1p1multiple1").valueAsString));
I moved the *.05 from the end to just after the first statement. Running it through the console it says it is right, but the calculation for example for 5*.5*2 comes up 5 when it should be returning 4
5 halved is 2.5 rounded down to 2 * 2 = 4
I am really rusty on my javascript haven't used it in years and trying to get back in is proving to be a bear. Thank you for your help.
