Using java(regex) how to strip float decimal having trailing zeros. If the decimal value contains non-zeros[1 to 9] then do not strip.
I tried using java replaceAll as below but its stripping all zeros even if there is non zero value after decimal
new Float(12.50f).toString().replaceAll("\\.0*$", "")
Ex: 12.0 should trim to 12
12.5 should be 12.5
12.50 should be 12.50
12.000 should trim to 12
14.0056 should be 14.0056