Assuming test5 is required, the following result was found.
v_Test4 = 12.300; info v_Test4.toString().replaceAll("^(^-?\\d+\\.\\d*[1-9])(0+$)|(\\.0+$)", "$1", false); // yields 12.3 v_Test5 = 12.345; info v_Test5.toString().replaceAll("^(^-?\\d+\\.\\d*[1-9])(0+$)|(\\.0+$)", "$1", false); // yields 12.345 v_Test6...