Description
Calculate type question behaves differently on certain numbers and creates unnecessary decimal digits.
Related: Decimal creating more digit in decimal part
Steps to Reproduce
A)
- Create an
integer
type question (Q1) - Create a
calculate
question (C1) with a simple${Q1} * 1.1
formula. - Create a
note
to display${C1}
- Write 100 to Q1.
- The
note
displays 110.00000000000001 instead of 110
B)
- Create two
decimal
questionsQ2
andQ3
- Create a
calculate
question (C4) with a simple${Q2} + ${Q3}
formula. - Create a note to display
${C4}
. - Write 2.32 and 1.32 to
Q2
andQ3
. - The note displays 3.6399999999999997 instead of 3.64
Expected behavior
The expected behavior is to calculate
works same in every number.
Actual behavior
The calculate
works different for some numbers. See screenshots for different behaviors:
Additional details
-
So far, I’ve tested and confirmed that these numbers create some sort of problem in the following calculation:
integer * 1.1
: “3, 6, 7, 11, 12, 100, 200, 400, 700, 800” -
There is a form where you can check additional calculations:
Enketo Express for KoboToolbox -
There is an xlsform with additional operators. Feel free to check it yourselves:
Calculate Problems.xlsx (10.1 KB)