I have a double (e.g: 123.45) and I need generate a string like 0000012345.
I'm trying to do it using only String.format (Formatter). I could use DecimalFormat and then replaceAll, but I was wondering if I could achieve the same result using formatter. The reason is that I will use it with FormatterLineAggregator (spring batch).
[EDIT] - Emphasis on the question reason. Tagged as spring batch also. Included link to spring batch documentation.
From Spring Batch doc: "... The underlying implementation is built using the same Formatter added as part of Java 5. The Java Formatter is based on the printf functionality of the C programming language. Most details on how to configure a formatter can be found in the javadoc of Formatter.".