reducing the decimal precision

0
mendix automatically makes the decimal precision after the decimal point to have 8 digits. I want it to be less when i process(as eventually i want to set this to String field of a webservice which takes String for this same field- underlying conversion in the target system is smart to handle this) by any chance 1.00000000 could be changed to 1.000 ?
asked
2 answers
0

This is what we eventually used. First we converted the Decimal to a String and then we stripped the trailing zeros with the following RegEx:

s = s.indexOf(".") < 0 ? s : s.replaceAll("0*$", "").replaceAll("\\.$", "");
answered
3

Use format decimal to format the decimal into a string with the amount of decimal places. https://world.mendix.com/plugins/servlet/mobile#content/view/9535772

answered