java/util

[java] NumberFormat 을 사용해서 double 가독성 있게 표현하기

짱가쟁이 2010. 6. 25. 18:11

- Sample
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMinimumFractionDigits(9);
nf.setGroupingUsed(false);

nf.format((double)228588.0/(double)1000000000.0);

- Result
0.000228588