Code example for DecimalFormat

Methods: setGroupingUsedsetMaximumFractionDigitssetMinimumFractionDigits

0
 *   The first 3 params above are the only required ones. 
 */ 
@Path("/adaptor") 
public class AdaptorController { 
 
  private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat();
  private static final Log log = LogFactory.getLog(AdaptorController.class);
 
  static { 
    DECIMAL_FORMAT.setMinimumFractionDigits(2);
    DECIMAL_FORMAT.setMaximumFractionDigits(2);
    DECIMAL_FORMAT.setGroupingUsed(false);
  } 
 
  /** 
   * Adds an adaptor to the agent and returns the adaptor info. 
   * @param context servletContext 
   * @param viewType type of view to return (text|xml) 
   * @param postBody JSON post body 
   * @return Response object 
Contextual code suggestions in your IDE  Get Codota for Java