Java Format - Java DecimalFormat .getRoundingMode ()








Syntax

DecimalFormat.getRoundingMode() has the following syntax.

public RoundingMode getRoundingMode()

Example

In the following code shows how to use DecimalFormat.getRoundingMode() method.

/*ww  w. java 2 s .c o m*/

import java.text.DecimalFormat;

public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    
    System.out.println(format.getRoundingMode().name());

  }
}

The code above generates the following result.