reducing the decimal precision

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 ?
2 answers

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("\\.$", "");

Use format decimal to format the decimal into a string with the amount of decimal places.