Absolute value

Hello,

Is there an absolute value function for ODK forms? I'm trying to add a
constraint that takes the absolute value of the difference of two numbers.
I did a search of this forums previous absolute value questions, but I did
not understand the answers.

Any insight you can offer is appreciated.

Thank you

Musyoka,

I don't think there is an abs method. Bug report at
https://code.google.com/p/opendatakit/issues/detail?id=998. Code
contributions are welcome.

In the meanwhile, take the difference of the numbers, and then use a
calculate to find the abs. The formula will look something like this..

if (/data/difference < 0, /data/difference * -1, /data/difference)

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Tue, Sep 30, 2014 at 7:32 AM, Musyoka Munyoki mmunyoki@gmail.com wrote:

Hello,

Is there an absolute value function for ODK forms? I'm trying to add a
constraint that takes the absolute value of the difference of two numbers. I
did a search of this forums previous absolute value questions, but I did not
understand the answers.

Any insight you can offer is appreciated.

Thank you

--

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.

Thank you Yaw.

··· On Tuesday, September 30, 2014 10:32:04 AM UTC-4, Musyoka Munyoki wrote: > > Hello, > > Is there an absolute value function for ODK forms? I'm trying to add a > constraint that takes the absolute value of the difference of two numbers. > I did a search of this forums previous absolute value questions, but I did > not understand the answers. > > Any insight you can offer is appreciated. > > Thank you >