类型转换

来源:互联网 发布:乎乎合适的词 编辑:程序博客网 时间:2024/05/20 07:53

String到Long的转换,避免出现java.lang.NumberFormatException: For input string: “1.0”
at java.lang.NumberFormatException.forInputString(Unknown Source) 的问题

    String ids = ExpImpUtils.toStr(excelRowMap.get("扇区号"));    Long id =  new Double(Double.parseDouble(ids)).longValue();    System.out.println("id "+ id);

String转换为BigInteger。

String s="11111111111111111111";BigInteger b1=new BigInteger(s);
0 0
原创粉丝点击