We would like to know how to left left justify a float point value format.
import java.util.Formatter; /*from ww w . j a v a2 s . co m*/ public class MainClass { public static void main(String args[]) { Formatter fmt = new Formatter(); fmt.format("|%-10.2f|", 123.123); System.out.println(fmt); } }
The code above generates the following result.