Topic: 请教(如何把double型输出为指定小数点后位数)

  Print this page

1.请教(如何把double型输出为指定小数点后位数) Copy to clipboard
Posted by: sammi8190
Posted on: 2005-05-09 10:38

如何把double型输出为指定小数点后位数
例如 1/3 指定小数点后1位 = 0.3

2.Re:请教(如何把double型输出为指定小数点后位数) [Re: sammi8190] Copy to clipboard
Posted by: why
Posted on: 2005-05-09 20:44

http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html
http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html

http://javaalmanac.com/egs/java.text/FormatNumExp.html


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923