Java BigDecimal Format format(final BigDecimal bd)

Here you can find the source of format(final BigDecimal bd)

Description

return a Number formatted or empty string if null.

License

Apache License

Parameter

Parameter Description
bd a parameter

Declaration

public static String format(final BigDecimal bd) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;
import java.text.NumberFormat;

public class Main {
    private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance();

    /**/*  ww  w.  jav  a2 s.  c o  m*/
     * return a Number formatted or empty string if null.
     * 
     * @param bd
     */
    public static String format(final BigDecimal bd) {
        return bd != null ? NUMBER_FORMAT.format(bd) : "";
    }
}

Related

  1. format(BigDecimal no, String formatter)
  2. format(BigDecimal num)
  3. format(BigDecimal num)
  4. format(BigDecimal num)
  5. format(BigDecimal number, String format)
  6. format(Object value, Integer precision)
  7. format(String pattern, final double secondInDouble)
  8. format2Scale(BigDecimal obj)
  9. format2String(BigDecimal bd)