object 转换long

 

        double a = 345.0;

        Object b = a;

        NumberFormat n=NumberFormat.getInstance(); 

        n.setParseIntegerOnly(true);

        String d=n.format(b);

        long c = Long.parseLong(d);

你可能感兴趣的:(object)