Programming
No. | 577 |
Name. | swindler |
Subject. | 숫자를 포맷에 맞게 출력하기 |
Main Cate. | Java |
Sub Cate. | |
Date. | 2009-02-16 17:24 |
Hit. | 3205 (211.43.206.101) |
File. | |
1.40f 를 "1.40" 이런식으로 고정길이에 맞춰서 출력하기 위해서는 아래와 같이 사용한다. ####.## 와 같이 하면 길이가 조정된다. String pattern = "0000.00"; DecimalFormat dformat = new DecimalFormat( pattern ); float num = 1.40f; System.out.println( dformat.format( num ) ); [바로가기 링크] : http://coolx.net/cboard/develop/577 |
|
|
|
[Modify] [Delete] | [Reply] [List] |