Limit the decimal value entry

Good day all,

We would like to ask for the estimate distance from the house to the
respondent's work place.

In our XLSForm, we use decimal where the user can entry, 1.2312341231312.

But we would like to limit the decimal point into 2 only, to have it
somehow 1.23 only.

Thanks...

I recommend that you do not do this.

Instead, round the numbers when you perform your data analysis, not during
data collection.

Decimal numbers are represented internally in binary floating point. The
conversion from decimal to binary will always introduce small (9th digit)
rounding errors. In my opinion, it is better to just accept that than to
fight it.

If you reeeaaallly want to do it, you would need to create a calculated
field to hold the rounded value that is constructed from the user-entered
value. See the round(x,p) function -- same properties as the one in Excel.

··· On Tue, Feb 17, 2015 at 12:36 AM, neil jerson wrote:

Good day all,

We would like to ask for the estimate distance from the house to the
respondent's work place.

In our XLSForm, we use decimal where the user can entry, 1.2312341231312.

But we would like to limit the decimal point into 2 only, to have it
somehow 1.23 only.

Thanks...

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Thank you so much Mitch..

We will follow what you have suggested.

God bless..

··· On Tuesday, February 17, 2015 at 10:05:17 AM UTC-8, Mitch Sundt wrote: > > I recommend that you do not do this. > > Instead, round the numbers when you perform your data analysis, not during > data collection. > > Decimal numbers are represented internally in binary floating point. The > conversion from decimal to binary will always introduce small (9th digit) > rounding errors. In my opinion, it is better to just accept that than to > fight it. > > If you reeeaaallly want to do it, you would need to create a calculated > field to hold the rounded value that is constructed from the user-entered > value. See the round(x,p) function -- same properties as the one in Excel. > > > On Tue, Feb 17, 2015 at 12:36 AM, neil jerson <bara...@gmail.com > wrote: > >> Good day all, >> >> >> We would like to ask for the estimate distance from the house to the >> respondent's work place. >> >> In our XLSForm, we use decimal where the user can entry, 1.2312341231312. >> >> But we would like to limit the decimal point into 2 only, to have it >> somehow 1.23 only. >> >> >> Thanks... >> >> >> >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >