Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

decimals for numeric hidden variable

I have a numeric hidden variable in the survey and in that data stored without decimals. Is there a way I can store the calculated number with decimal place?

Stored data from SPSS file:

Code Used:

<input name="H11_A" id="H11_A" type="hidden" value="[% S11_A/(556+(H10_HH-1)*396)*1]">
asked Jul 13, 2012 by Lawrence Bronze (2,100 points)
retagged Sep 13, 2012 by Walter Williams

1 Answer

0 votes
It's a bit of a workaround, but for saving numbers with decimals set the field to text, rather than numeric.  Currently numerics are considered integers, so they won't keep your points of precision.  Then, if you need to use the saved field for any future calculations, wrap in inside a StringToNumber() function.

I believe we are planning on adding a third option to free format hidden variables in the next update so there will be String, Numeric (integer) and Numeric (rational/decimal/something to denote we won't round it).
answered Jul 16, 2012 by Brian McEwan Gold Sawtooth Software, Inc. (37,410 points)