Table 3-6. Flags for printf
|
Flag |
Purpose |
Example |
|
+ |
Prints sign for positive and negative numbers |
+3333.33 |
|
space |
Adds a space before positive numbers |
| 3333.33| |
|
0 |
Adds leading zeroes |
003333.33 |
|
- |
Left-justifies field |
|3333.33 | |
|
( |
Encloses negative number in parentheses |
(3333.33) |
|
, |
Adds group separators |
3,333.33 |
|
# (for f format) |
Always includes a decimal point 首页
上页
下页
尾页
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
[22]
[23]
[24]
[25]
[26]
[27]
[28]
[29]
[30]
本文关键:JDK5.0的11个主要新特征
相关方案
|