Java(初学者)将科学计数法转换为十进制 [英] java (beginner) converting scientific notation to decimal
本文介绍了Java(初学者)将科学计数法转换为十进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
if
double d = 1.999e-4
我希望输出为0.0001999。
I want my output to be 0.0001999.
我该怎么做?
推荐答案
NumberFormat formatter = new DecimalFormat("###.#####");
String f = formatter.format(d);
您可以浏览 NumberFormat
的子类班级了解更多详细信息。
You can explore the sub classes of NumberFormat
class to know more details.
这篇关于Java(初学者)将科学计数法转换为十进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文