Java Number Format Pattern toDecimalFormat(BigDecimal value)

Here you can find the source of toDecimalFormat(BigDecimal value)

Description

to Decimal Format

License

Open Source License

Declaration

public static String toDecimalFormat(BigDecimal value) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;
import java.text.DecimalFormat;

public class Main {
    public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("$###,##0.00");

    public static String toDecimalFormat(BigDecimal value) {
        return value != null ? DECIMAL_FORMAT.format(value) : "$0.00";
    }// ww  w .j  a  v a  2 s . com
}

Related

  1. roundNumber(Number number, DecimalFormat format)
  2. stringFormat(BigDecimal value)
  3. stringToReais(String unformatted, boolean comSimbolo)
  4. strToFormatedNumber(String str)
  5. toAccountantFormat(String str, int scale)
  6. toFormattedNumber(Object value)
  7. toNumber(String numString, String numFormatPattern)
  8. toNumberFormat(String input)
  9. toString(int[] a, String separator, NumberFormat formatter)