A few quick examples of aligning text and formatting floating point numbers, including:
- examples using
String.format()
from the Java standard API - examples using
StringUtils
from Apache's Commons Lang library, which attempts to make up for some of the standard Java API's many failings.
See the App.java source code for details.
Note that the .jar
file with the Commons Lang library has been downloaded and placed within the lib directory.