How to use Format Flags to control Java Formatter
Description
Flags that controls various aspects of a conversion. All format flags are single characters and follow the % in a format specification.
Flag List
The flags are shown here:
Flag | Effect |
---|---|
- | Left justification |
# | Alternate conversion format |
0 | Output is padded with zeros rather than spaces |
space | Positive numeric output is preceded by a space |
+ | Positive numeric output is preceded by a + sign |
, | Numeric values include grouping separators |
( | Negative numeric values are enclosed within parentheses |