JAVA 中Double类型转换为String类型
转载
JAVA 中Double类型转换为String类型
在JAVA中,当一个Double类型的数据整数部分超过6位时,就会用科学计数法表示,
如(123456789.50)表示为(1.234567895E8)若想把Double类型转换为String,则
可以用下边的方法
public static void main(String[] args) {
double s=123456789.50;
DecimalFormat format = new DecimalFormat("#.00");
String sMoney = format.format(s);
System.out.println(sMoney);
}