Round calculator output

96
2
01-28-2019 12:36 AM
Highlighted
Esri Regular Contributor

Hello folks, 

I have an integer question field with the calculator appearance setting. The output of the calculator gives two digits which makes the answer to my integer question invalid. Is there a way to round the output of the calculator output? (That would be my prefered way...)

I guess the alternative way would be to use decimal answer and bind::esriFieldTypeInteger? Does that work?

Tags (1)
Reply
0 Kudos
2 Replies
Highlighted
Esri Regular Contributor

Hi Nicole

Just to clarify, you would like the user to be able to submit a decimal for a question, but only store a rounded integer for that question?

I'm fairly sure setting esriFieldTypeInteger on a decimal question would truncate the input instead of rounding it (e.g. input of 546.82 would result in 546).

One option could be to make the input a decimal question with calculator appearance (and optionally use bind::esri:fieldType = null so that it's not stored in the feature service), then have a hidden question (with esriFieldTypeInteger) using the round formula in the calculation column, e.g. round(${decimal},0).

Hope this helps,

Jim

Highlighted
Esri Regular Contributor

Thank you for your input Jim! That could be a workaround. I will see how the enumerators feel annoyed by the current functionality. I have like 30 fields where I would have to do it the way you described it but I don't know yet how handy the calculator comes or how much it will be really used. 

Reply
0 Kudos