Java BigDecimal Format formatDecimal(BigDecimal num)

Here you can find the source of formatDecimal(BigDecimal num)

Description

format Decimal

License

Open Source License

Declaration

public static String formatDecimal(BigDecimal num) 

Method Source Code

//package com.java2s;
/**//ww  w.java2s .  co  m
 * Copyright (c) 2005, 2013, Werner Keil and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Grahame Grieve - initial API and implementation
 */

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

public class Main {
    public static String formatDecimal(BigDecimal num) {
        return NumberFormat.getInstance(Locale.US).format(num);
    }
}

Related

  1. formatBigDecimal(String value)
  2. formatBigDecimalWithPrecise(BigDecimal number)
  3. formatCents(int cents)
  4. formatCUBRIDNumber(BigDecimal value)
  5. formatDecimal(BigDecimal b)
  6. formatDecimal(BigDecimal number, int maxFractionDigits, int minFractionDigits)
  7. formatDecimalCost(BigDecimal value)
  8. formatDigit(double value, int scale)
  9. formatDouble(double d)