Printf format string refers to a control parameter used by a class of functions in the input/output libraries of C and many other programming languages (from Wikipedia - read full article).
Many languages support a flavor of printf functionality natively. Eclypse can recognize the following printf style format placeholders.
Name | Pattern | Discussion |
---|---|---|
unordered string | %s | You use this pattern when you want to replace the placeholder with a literal string (text). |
ordered string | %1$s, %2$s, ... | You use this pattern when you need to specify the order of placeholders in a text. Especially useful when the content includes more than one placeholder. For example: Highest temperature is %1$d in %2$s. |
unordered signed integer | %i or %d or %li or %ld | the uppercase counterparts %I, %D, %lI, %lD are also recognized. |
unordered unsigned integer | %u or %lu | the uppercase counterparts %U, %lU are also recognized. |
ordered integer | %1$i, %2$d or %1$li, %2$ld, ... | the uppercase counterparts %1$I, %2$D, %1$lI, %2$lD are also recognized. |
ordered unsigned integer | %1$u, %2$u or %1$lu, %2$lu, ... | the uppercase counterparts %1$U, %2$U, %1$lU, %2$lU are also recognized. |
unordered float | %f | You use this pattern when you want to replace the placeholder with a floating point number. |
unordered float with decimal precision | %.1f, %.2f, %.3f, ... | You use this variation if you want to specify the precision of the floating point. ".3" notation gives you 3 significant digits. For example: 394.285. |
ordered float with decimal precision | %1$.2f, %2$.2f, %3$.2f, ... | You can also specify the order of the floating point placeholders. |