Java BigDecimal Format format(BigDecimal decimal)

Here you can find the source of format(BigDecimal decimal)

Description

format

License

Mozilla Public License

Declaration

public static String format(BigDecimal decimal) 

Method Source Code

//package com.java2s;
/*/*from ww  w . jav  a  2s  .  com*/
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.math.BigDecimal;

import java.text.DecimalFormat;

public class Main {
    public static String format(BigDecimal decimal) {
        DecimalFormat df = new DecimalFormat("#,###.##");
        return df.format(decimal);
    }
}

Related

  1. fmtBdToInt(BigDecimal bd)
  2. format(BigDecimal amount, String format)
  3. format(BigDecimal decData, int precision, int scale)
  4. format(BigDecimal n, int prec)
  5. format(BigDecimal n, int prec)
  6. format(BigDecimal no, String formatter)
  7. format(BigDecimal num)