去除多余的0,BigDecimal去除无效的0
public static void main(String[] args) { String a="0.3330000"; BigDecimal bigDecimal = new BigDecimal(a); String s = bigDecimal.stripTrailingZeros().toPlainString(); System.out.println(s); }
public static void main(String[] args) { String a="0.3330000"; BigDecimal bigDecimal = new BigDecimal(a); String s = bigDecimal.stripTrailingZeros().toPlainString(); System.out.println(s); }