Mega Code Archive

 
Categories / Java Tutorial / Development
 

Using the Format Flags

Formatter uses a set of format flags to control various aspects of a conversion. A format flag follows the % in a format specification. FlagEffect -Left justification #Alternate conversion format 0Output is padded with zeros rather than spaces spacePositive 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