Date/Time
For more date/time formatting see hereDecimals and Money
Gotcha: If you are specifying each argument by it's index (%1, %2, etc) you need to add the '$' before any formatting, i.e.%2$.2f
Special Flags and New Line
You can also use special flags such as negative numbers in parans, zero-padding, and comma groupingThese examples cover the most common use cases of String formatting, but for more information you can check out the javadocs
No comments:
Post a Comment