你可以使用
printf()同
%f:
double dexp = 12345678;System.out.printf("dexp: %fn", dexp);这将打印
dexp: 12345678.000000。如果你不想要小数部分,请使用
System.out.printf("dexp: %.0fn", dexp);这使用了文档中说明的格式说明符语言。

你可以使用
printf()同
%f:
double dexp = 12345678;System.out.printf("dexp: %fn", dexp);这将打印
dexp: 12345678.000000。如果你不想要小数部分,请使用
System.out.printf("dexp: %.0fn", dexp);这使用了文档中说明的格式说明符语言。