I need to add zeros to the left of a number until it gets six digits.
Ex. If the number is 5, it should be formatted as 000005.
Can someone please let me know how to achieve this in Java?
You can use,
for zero-padding with length=6.
More info on: http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
It looks like you're new here. If you want to get involved, click one of these buttons!