글쓴이 :윤경구 2000년 2월 29일 13:52:19
In Reply to: [질문] double number 의 출력방법 posted by 이태영 on 2000년 2월 29일 12:45:37:
다음과 같이 해보세요...
double value = 1.0 / 3.0;
try {
String formatted = new java.text.DecimalFormat("0.00").format(value);
System.out.println("value = " + value);
System.out.println("formatted = " + formatted);
} catch (IllegalArgumentException e) {
System.out.println("Exception : " + e);
}