# System requesting an integer number when user inputing decimal number to a field with decimal datatype

**URL:** <https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082>\
**Category:** Support\
**Created:** [January 27, 2021, 3:29am UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082 "2021-01-27T03:29:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliahadss24](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/aliahadss24/32/604_2.png) [@aliahadss24](https://forum.odk-x.org/u/aliahadss24)\
**Post date:** [January 27, 2021, 3:29am UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/1 "2021-01-27T03:29:34Z")

</div>

I have a field with decimal data type. When user input a decimal number and click next, error shows up requesting a value that has no decimal separator. User is able to move to different field by manually clicking the next field, but there is no guarantee that the previous field’s value stored as decimal. Below is the image.

 ![Screenshot_20210127-101936_SL ODK Survey](https://odkx.b-cdn.net/uploads/default/original/1X/f076f3b88f514d225046e358dc78d103ea71efdb.jpeg)  
 ![unknown-2](https://odkx.b-cdn.net/uploads/default/original/1X/aaab5c556e137867c03a1768e2839dd5b3841470.png)

1. Is it a normal behaviour? Does the decimal value will be stored as decimal despite the error?
2. What is the correct type on survey sheet for inputing a decimal/float value?

Any help would be very appreciated

---

<div class="post-metadata">

**Author:** ![elmps2018](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/elmps2018/32/105_2.png) [@elmps2018](https://forum.odk-x.org/u/elmps2018)\
**Post date:** [January 27, 2021, 2:32pm UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/2 "2021-01-27T14:32:23Z")

</div>

This is weird! We use the decimal type and usually it behaves just fine. One thing to double check is whether the model statement has a different type, like integer, or somewhere else in the survey, for this variable. Does it happen for all the decimal variables or just this one? Are there any additional attributes applied?

We haven’t run into the exact decimal issue, but sometimes have run into issues with language settings, where depending on how a particular tablet level language setting does dates or something it caused an issue. I know some countries use . or , for decimals so that might be worth double checking in the tablet settings.

---

<div class="post-metadata">

**Author:** ![linl33](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/l/b487fb/32.png) [@linl33](https://forum.odk-x.org/u/linl33)\
**Post date:** [January 28, 2021, 1:58am UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/3 "2021-01-28T01:58:18Z")

</div>

You can increase the resolution of the field by adding an `inputAttributes.step` column to your prompt. Looks like some devices have a default resolution of 1 and others have a default resolution of 0.1.

See here for documentation on `inputAttributes`  
[https://docs.odk-x.org/xlsx-converter-reference/?highlight=inputattributes#optional-columns](https://docs.odk-x.org/xlsx-converter-reference/?highlight=inputattributes#optional-columns)

See here for documentation on `step`

> **[\- HTML: HyperText Markup Language | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#htmlattrdefstep)**
>
> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.

---

<div class="post-metadata">

**Author:** ![aliahadss24](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/aliahadss24/32/604_2.png) [@aliahadss24](https://forum.odk-x.org/u/aliahadss24)\
**Post date:** [February 2, 2021, 8:08am UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/4 "2021-02-02T08:08:53Z")

</div>

Thanks @elmps2018 and @linl33 for the insight. This decimal issue is happened in all forms that using decimal prompt type. I assumed my tablet is using . for decimal since if I open the default calculater app, the default decimal separator is .

I currently doesn’t use additional attributes when I post the questions.

As mentioned by @linl33, I added inputAttributes.step column and set the value to 0.001. Sadly, the problem persist. Below is my forms (it’s a very short forms and the model that has decimal type is initialized on this form, not from other forms).

 ![image](https://odkx.b-cdn.net/uploads/default/original/1X/7ef31cae98639b62c4148b2bae41362c8b7e0654.png) [survey\_2\_ba\_draft\_heel.xlsx](https://forum.odk-x.org/uploads/short-url/5ugid35W7Or0pcKQD6xKk8ySSzK.xlsx) (18.8 KB)

Any additional input will be appreciated 🙂 , I’ve been strugling to fix this problem this past couple weeks.

---

<div class="post-metadata">

**Author:** ![linl33](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/l/b487fb/32.png) [@linl33](https://forum.odk-x.org/u/linl33)\
**Post date:** [February 2, 2021, 2:17pm UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/5 "2021-02-02T14:17:46Z")

</div>

There is a leading space in your `inputAttributes.step` column. Fixing that should solve your problem.

---

<div class="post-metadata">

**Author:** ![aliahadss24](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/aliahadss24/32/604_2.png) [@aliahadss24](https://forum.odk-x.org/u/aliahadss24)\
**Post date:** [February 3, 2021, 2:04am UTC](https://forum.odk-x.org/t/system-requesting-an-integer-number-when-user-inputing-decimal-number-to-a-field-with-decimal-datatype/1082/6 "2021-02-03T02:04:40Z")

</div>

You’re right! thanks for pointing that out 😉
