我们在做数据类型转换的时候,会发现数值变化了。例
54346084 ———》5.4346084E7
这是因为转化为double之后,用科科学计数法来表示,所以感觉数值有了偏差。
String UsagesSTORAGE1 = “54346084”;
Double UsagesSTORAGE2 = Double.valueOf(UsagesSTORAGE1);
Double UsagesSTORAGE3 = Double.parseDouble(UsagesSTORAGE1 );
Integer UsagesSTORAGE4 = Integer.parseInt(UsagesSTORAGE1 );
System.out.println("UsagesSTORAGE: "+UsagesSTORAGE1);
System.out.println("UsagesSTORAGE: "+UsagesSTORAGE2);
System.out.println("UsagesSTORAGE: "+UsagesSTORAGE3);
System.out.println("UsagesSTORAGE: "+UsagesSTORAGE4);