java字符串拼接时出现科学计数法问题

public class kxjsf {
    public static void main(String[] args) {
        String str = "这是拼接后的字符串:";
        Double aa =1000000000d;

        NumberFormat nf = NumberFormat.getInstance();
        System.out.println(str+aa);//这是拼接后的字符串:1.0E9
        System.out.println(str+nf.format(aa));//这是拼接后的字符串:1,000,000,000
        System.out.println(str+nf.format(aa).replace(",",""));//这是拼接后的字符串:1000000000

    }
}

 

posted @ 2022-05-18 17:30  花田007  阅读(170)  评论(0编辑  收藏  举报