Argument Index

Java-Argument Index

Argument Index Formatter includes a very useful feature that lets you specify the argument to which a format specifier applies. Normally, format specifiers and arguments are matched in order, from left to right. That is, the first format specifier matches the first argument, the second format specifier matches the second argument, and so on. However, … Read more…

Precision Specifier

Java-Precision Specifier

Precision Specifier A precision specifier can be applied to the %f, %e, %g, and %s format specifiers, among others. It follows the minimum field-width specifier (if there is one) and consists of a period followed by an integer. Its exact meaning depends upon the type of data to which it is applied. When you apply … Read more…

Java-Minimum Field Width Specifier

Minimum Field Width Specifier An integer placed between the % sign and the format conversion code acts as a minimum field-width specifier. This pads the output with spaces to ensure that it reaches a certain minimum length. If the string or number is longer than that minimum, it will still be printed in full. For … Read more…

Formatting Time and Date

Java-Formatting Time and Date

Formatting Time and Date The conversion specifier %t is used to format time and date information. The %t specifier works a bit differently than the others because it requires the use of a suffix to describe the portion and precise format of the time or date desired. For example, to display time, you would use … Read more…