Displaying numbers with leading zeroes

import java.text.*;
  
public class Main {
   public static void main(String args[]) {
      System.out.println(lead("0000000000", 12345.0));
      System.out.println(lead("00000.00", 456.1));
      System.out.println(lead("00000.00", 123456.789));
   }
 
   public static String lead(String mask, double d) {
      DecimalFormat df = new DecimalFormat(mask);
      return df.format(d);
   }
}

outputs:

0000012345
00456.10
123456.79