DecimalFormat GetRoundingMode() Example
Gets the RoundingMode used in this DecimalFormat.
DecimalFormatclass GetRoundingMode() method example. This example shows you how to use GetRoundingMode() method.This method Gets the RoundingMode used in this DecimalFormat.
Here is the code:-
/**
* @Program that Gets the Rounding Mode used in this DecimalFormat.
* GetRoundingMode.java
* Author:-RoseIndia Team
* Date:-12-Jun-2008
*/
import java.text.*;
public class GetRoundingMode {
public static void main(String[] args) {
// Creates a DecimalFormat object
DecimalFormat d = new DecimalFormat("3.65532");
// Get the positive suffix.
System.out.println("The Rounding Mode is: "+d.getRoundingMode());
}
} |
Output of the Program
| The Rounding Mode is: HALF_EVEN |
|