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