Decimal creating more digit in decimal part

Hi,

I am working on the agriculture related project.

We have the questions asking about farmer land use in the order

  1. How many hectare of cultivated land you have ? answer in decimal
    1.1 How many hectare of CROP 1 cultivated land you have? answer in decimal
    1.2 How many hectare of CROP 2 cultivated land you have? answer in decimal

To validate the land - 1.1 +1.2 = 1 if not it showed the message that they need to redo it

We started having problem when data collector answer as :

  1. How many hectare of cultivated land you have ? 2.64
    1.1 How many hectare of CROP 1 cultivated land you have? 2.32
    1.2 How many hectare of CROP 2 cultivated land you have? 0.32

But the validating message showed the sum of 1.1. and 1.2 as: 2.6399999999999997
which has 13th decimal- and this is not match with the total number which inputted in 1 which is 2.64

Hope that you guys can helps,

Jen

Hello @Jan_L,
Could you provide an extract of the related form part and a screenshot with data entry and mesaage, please?

1 Like

Hi @wroos,

Here is my screenshot, and also attached is the xls form ,

Hope you can help,

Jen
Rice_Production_9May2022.xlsx (87.0 KB)

@Jan_L, maybe this post discussed previously should help you solve your issue:

Thank you @Kal_Lam

The problem is that the form create 13 digits after decimal when I enter only 2 digits after decimal.

I enter 2.32, and 0.32 which expected the output (2.32 +0.32= 2.64) but Kobo generate this 2.63999999999997

I dont know why and how to solve this,
Best,

@Kal_Lam

I took a screenshot here, you can see the differences between other number


The have tried round up but it messed with other number, howcan I tell Kobo to take exact number that input when it has x.x2 + x.x2

Hope you can helps,
Jen

Hi @Jan_L,

I’ve created a bug report in here including the problem you’re facing too:

Feel free to test and provide additional details.
Best,

1 Like

Thanks for additional point, :slight_smile:

1 Like

@Jan_L, could you also test this with the Collect android app to see if it behaves differently than Enketo? cc: @hakan_cetinkaya

Hi @Kal_Lam

Yes, the data collector using this on collect app and having the same issue.

Best

1 Like