NumberFormat GetRoundingMode() Example
Gets the RoundingMode used in this NumberFormat.
NumberFormatclass GetRoundingMode() method example. This example shows you how to use GetRoundingMode() method.This method Gets the RoundingMode used in this NumberFormat.
Here is the code:-
/**
* @Program that Gets the RoundingMode used in this NumberFormat.
* GetRoundingMode.java
* Author:-RoseIndia Team
* Date:-17-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetRoundingMode {
public static void main(String[] args) {
//Creating Numberformat instance
NumberFormat nf = NumberFormat.getInstance();
System.out.println("RoundingMode used in this NumberFormat is: "
+nf.getRoundingMode());
}
} |
Output of the program:-
| RoundingMode used in this NumberFormat is: HALF_EVEN |
|