currency Format for BigDecimal - Android java.math

Android examples for java.math:BigDecimal

Description

currency Format for BigDecimal

Demo Code

import android.location.Location;
import java.math.BigDecimal;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main{

    public static String currencyFormat(BigDecimal n) {
        return NumberFormat.getCurrencyInstance().format(n);
    }//from   w  w w.  j ava  2s.c o m

}

Related Tutorials