DecimalFormat GetMinimumIntegerDigits() Example
Gets the minimum number of digits allowed in the integer portion of a number.
DecimalFormatclass GetMinimumIntegerDigits() method example. This example shows you how to use GetMinimumIntegerDigits() method.This method Gets the minimum number of digits allowed in the integer portion of a number.
Here is the code:-
/**
* @Program that Gets the minimum number of digits allowed in the integer
* portion of a number.
* GetMinimumIntegerDigits.java
* Author:-RoseIndia Team
* Date:-12-Jun-2008
*/
import java.text.*;
public class GetMinimumIntegerDigits {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat();
//Gets the minimum number of digits allowed in the integer portion of a number.
System.out.println("The minimum number of digits allowed in the integer portion of a number is: "
+ d.getMinimumIntegerDigits());
}
} |
Output of the Program
| The minimum number of digits allowed in the integer portion of a number is: 1 |
|