2013-07-23 46 views

回答

1

如果需要格式化輸出,例如打印或在一個TextView,用它顯示:

DecimalFormat threeDecRound = new DecimalFormat(); 
threeDecRound.setMaximumFractionDigits(3); 
threeDecRound.setRoundingMode(RoundingMode.HALF_DOWN); 
threeDecRound.format(number) 
相關問題