我們在做數據類型轉換的時候,會發現數值變化了。例
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);