Rounding down
I'm trying to get a field in my pdf to round down or basically drop any cents after the decimal. For example I want $283.50 to be $283 not $284. It's a field that is giving the average of several other fields.
I'm trying to get a field in my pdf to round down or basically drop any cents after the decimal. For example I want $283.50 to be $283 not $284. It's a field that is giving the average of several other fields.
I am working on a form for work, per our policy we drop the cents on all income amounts. I am looking to just get whole dollar amounts without the results rounding up. For example if the total income is $283.50. I need it to be $283. This Field is an average of other fields. When I use this script it averages right, but I can't figure out how to add the Math.floor script so that any value that goes into the field doesnt round up.
event.value = Avg("Pay1", "Pay2", 'Pay3', 'Pay4', 'Pay5', 'Pay6', 'Pay7', 'Pay8', 'Pay9','Pay10', 'Pay11', 'Pay12', 'Pay13');
Add this to the end of your code:
event.value = Math.floor(event.value);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.