NumberFormat GetMinimumIntegerDigits() Example
Returns the minimum number of digits allowed in the integer portion of a number.
NumberFormatclass GetMinimumIntegerDigits() method example. This example shows you how to use GetMinimumIntegerDigits() method.This method Returns the minimum number of digits allowed in the integer portion of a number.
Here is the code:-
/**
* @Program that Returns the minimum number of digits allowed in the integer
* portion of a number.
* GetMinimumIntegerDigits.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetMinimumIntegerDigits {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getIntegerInstance();
//Returns the maximum number of digits allowed in the fraction
System.out.println("Minimum number of digits allowed in the integer is: "
+nf.getMinimumIntegerDigits());
}
} |
Output of the program:-
| Minimum number of digits allowed in the integer is: 1 |
|