ProAnswers.org

How to use Java Format Alternate Conversion?

import java.util.Formatter;

public class Main {

  public static void main(String args[]) {

    Formatter fmt = new Formatter();

    fmt.format("%#f", 1.0); 

    System.out.println(fmt);

  }

}

The output:

1.000000