Here you can find the source of formatAsCurrency(BigDecimal nAmount)
Parameter | Description |
---|---|
nAmount | a parameter |
public static String formatAsCurrency(BigDecimal nAmount)
//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); } }