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