Java DecimalFormat .setMinimumIntegerDigits (int newValue)
Syntax
DecimalFormat.setMinimumIntegerDigits(int newValue) has the following syntax.
public void setMinimumIntegerDigits(int newValue)
Example
In the following code shows how to use DecimalFormat.setMinimumIntegerDigits(int newValue) method.
import java.text.DecimalFormat;
//w w w . ja va 2s . c om
public class Main {
public static void main(String[] argv) throws Exception {
DecimalFormat format = new DecimalFormat();
format.setMinimumIntegerDigits(4);
System.out.println(format.format(123456789.12345678));
}
}
The code above generates the following result.