ProAnswers.org

What is Java Format Alternate Conversion?

# sets alternate conversion format.

 

The # can be applied to %o, %x, %e, and %f.

 

For %e and %f, the # ensures that there will be a decimal point even if there are no decimal digits.

 

Syntax

 

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

Example