2013-07-23 140 views

回答

1

如果需要格式化输出,例如打印或在一个TextView,用它显示:

DecimalFormat threeDecRound = new DecimalFormat(); 
threeDecRound.setMaximumFractionDigits(3); 
threeDecRound.setRoundingMode(RoundingMode.HALF_DOWN); 
threeDecRound.format(number) 
相关问题