Java Locale Format format(BigInteger amount)

Here you can find the source of format(BigInteger amount)

Description

format

License

Open Source License

Declaration

public static String format(BigInteger amount) 

Method Source Code

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

import java.math.BigInteger;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

import java.util.Locale;

public class Main {
    public static String format(int amount) {
        DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.GERMAN);
        otherSymbols.setDecimalSeparator(',');
        otherSymbols.setGroupingSeparator('.');
        DecimalFormat df = new DecimalFormat("###,###,###,##0", otherSymbols);
        return df.format(amount);
    }/*from  w ww. j  a  va  2s. c om*/

    public static String format(BigInteger amount) {
        if (amount == null) {
            return null;
        }
        DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.GERMAN);
        otherSymbols.setDecimalSeparator(',');
        otherSymbols.setGroupingSeparator('.');
        DecimalFormat df = new DecimalFormat("###,###,###,##0", otherSymbols);
        return df.format(amount);
    }
}

Related

  1. format(Date d, Locale locale)
  2. format(Date d, String format)
  3. format(Date date)
  4. format(Date date)