📜  java 字符串转十进制 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:10.159000             🧑  作者: Mango

代码示例1
String strDecimal = "0.00000008880000";
double f = Double.parseDouble(strDecimal);
System.out.println(f);
System.out.println(String.format("%.7f", f));
System.out.println(String.format("%.9f", new BigDecimal(f)));
System.out.println(String.format("%.35f", new BigDecimal(f)));
System.out.println(String.format("%.2f", new BigDecimal(f)));