How to set a decimal attribute on given entity in JavaScript on mobile

0
Try to set a decimal attribute on a given mxObject via javascript. Code is running as native mobile app ... mxObject.set(“Y”, 9.8100004196167);  …   leads to error on mobile: ReactNativeJS: Cannot set invalid value '9.8100004196167' to MxObject attribute 'Y'. What is the reason for this error?
asked
2 answers
1

The precision in the database is limited to 20 digits before and 8 digits after the decimal point – I can imagine this limitation is accounted for when setting a param over native? If you can set the value with 8 digits, you could try rounding the number to 8 decimals, or setting the amount with a multiplication factor to rule out imprecisions.

answered
0

How do these work out:

mxObject.set(“Y”, 9.81000042); 
mxObject.set(“Y”, 9.82); 
mxObject.set(“Y”, 9); 

Probably they all work fine. I think the problem is too many decimal digits. 8 is the max.

answered