DecimalFormat 格式化显示一个超过17位的大数时,在第17位四舍五入,如何解决?  BigDecimal amount=new BigDecimal("12345678901234567");
 NumberFormat usFormat =  NumberFormat.getCurrencyInstance(Locale.CHINA);
  DecimalFormat decFormat = (DecimalFormat)usFormat;  System.out.println(decFormat.format(amount));这怎么办呀,要重写一个格式化的类吗?求大家给个解决办法!

解决方案 »

  1.   


    1234567890123456789 ->1234567890123456770怎么才能成为1234567890123456789 ->1234567890123456789 ,即没有在最后进行处理
      

  2.   

    这可能是jdk支持的问题,最多整数位是17位。
      

  3.   

    机器啊, 打错了...¥1,234,567,890,123,456,789.00
    Press any key to continue...
      

  4.   

    太不可思议了
    http://community.csdn.net/Expert/topic/4353/4353183.xml?temp=.7334558
      

  5.   

    我顶!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!中国IT人才网(    http://www.itbbs.net.cn    )!
    免费招聘、求职。IT人工作的天堂。希望能够为大家所用。