Tag Archives: number padding

How to Left pad Zeros to integer to get String in Java

The below is the code as to how to add 0 Padding to the left of an integer to format it to string: import java.text.DecimalFormat; public String padZeros(int i) { DecimalFormat df = new DecimalFormat(“00”); return df.format(start); } Change the … Continue reading

Posted in Java | Tagged , , | Leave a comment