Java Currency Format formatAsCurrency(BigDecimal nAmount)

Here you can find the source of formatAsCurrency(BigDecimal nAmount)

Description

Formatea cantidades como moneda utilizando el default locale.

License

Open Source License

Parameter

Parameter Description
nAmount a parameter

Declaration

public static String formatAsCurrency(BigDecimal nAmount) 

Method Source Code

//package com.java2s;
/*/*ww w.ja v a2s  . c o  m*/
 * Copyright (C) 2010 Francisco Jos? Morero Peyrona. All Rights Reserved.
 *
 * This file is part of Tapas project: http://code.google.com/p/tapas-tpv/
 *
 * GNU Classpath is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the free
 * Software Foundation; either version 3, or (at your option) any later version.
 *
 * Tapas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * Tapas; see the file COPYING.  If not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

import java.math.BigDecimal;

import java.text.NumberFormat;

public class Main {
    private static final NumberFormat nfCurrency = NumberFormat.getCurrencyInstance();

    /**
     * Formatea cantidades como moneda utilizando el default locale.
     *
     * @param nAmount
     * @return
     */
    public static String formatAsCurrency(BigDecimal nAmount) {
        return nfCurrency.format(nAmount);
    }
}

Related

  1. currency(double amount, String language, String country)
  2. currency(double amount, String language, String country)
  3. currency(double value, NumberFormat nformat)
  4. currencyFormat()
  5. format2CurrencyWithComma(double amt)
  6. formatAsCurrency(final double value)
  7. formatAsCurrency(Number amount)
  8. formatAsCurrency(Number value)
  9. formatCurrency(BigDecimal amount)