Output Mask

Hello all,
am performing some calculations on a form whose output is of type decimal.
However I would like it so that the output rounds off the result to one
decimal place, so 83.77 becomes 83.8 or 83.73 remains 83.7. If this is not
possible, alternatively how do I mask the output so that I only get an
answer to one decimal place?

Thanks,
Tumaini

int(X) truncates X to an integer value. So this should work:

int(10*value+5)/10.0

This biases so that 83.75 rounds to 83.7

Mitch

ยทยทยท On Mon, Jun 25, 2012 at 3:22 PM, Tumaini Kilimba wrote:

Hello all,
am performing some calculations on a form whose output is of type decimal.
However I would like it so that the output rounds off the result to one
decimal place, so 83.77 becomes 83.8 or 83.73 remains 83.7. If this is not
possible, alternatively how do I mask the output so that I only get an
answer to one decimal place?

Thanks,
Tumaini

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

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