Calculations inexplicably malfunctioning in Numbers field [RESOLVED]

Hello there,

We use the Calculations function in a Numbers field to calculate Lead Scores for people who fill out our forms.

We input values for each answer choice, and have the values chosen for each question add up to give the overall Lead Score, which is then used to determine which Confirmation (Thank You Page) users are sent to.

We have had to update the scoring for our leads because our criteria has gotten more strict.

For some reason the field is now malfunctioning.

For example: Values -.4+.1+.2+.1 is giving the result: -2.7755575615628914e-17… a puzzling result.

We have the settings to “do not round”, and Validate Formula states that the formula appears to be valid.

Any idea what could be going on here?

@user5dcdecd7d0505094 welcome to the strange world of float point numbers: math - Avoiding problems with JavaScript's weird decimal calculations - Stack Overflow

If possible, I’d recommend shifting all numbers up a power so there are no decimals in your calculations e.g. -4+1+2+1. The other alternative is to enable rounding.

Good luck!

1 Like

Epic response Jake; thank you!

1 Like

This was interesting because we’ve always used decimals and had never had this problem before, but switching to all whole numbers solved it. Thank you.

1 Like