String s = "128166947252913248";
DecimalFormat df = new DecimalFormat("##########################.########");
Double oldTime1 = new Double(s);
Double oldTime2 = new Double("128166947252913249");
Double oldTime3 = new Double("128166947252913247");
Double newTime = new Double("116444736000000000");
System.out.println(newTime.longValue());
System.out.println(df.format(oldTime1));
System.out.println(oldTime1-newTime);
System.out.println(df.format(oldTime1-newTime));
System.out.println(df.format(oldTime3-newTime));
输出是:
116444736000000000
128166947252913248
1.1722211252913248E16
11722211252913248
11722211252913248
这是我正在处理的代码。我无法阻止双变量在最后一个变量处被截断。请帮助我在不被截断的情况下获得价值。