Package util

Source Code of util.Currency

/*
*
* Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the proprietary information of Sun Microsystems, Inc. 
* Use is subject to license terms.
*
*/

package util;

import java.text.NumberFormat;
import java.util.*;

public class Currency {

   private Locale locale;
   private double amount;
   public Currency() {
      locale = null;
      amount = 0.0;
   }

   public void setLocale(Locale l) {
      locale = l;
   }

   public void setAmount(double a) {
      amount = a;
   }

   public String getFormat() {
        NumberFormat nf = NumberFormat.getCurrencyInstance(locale);
        return nf.format(amount);
   }
}
TOP

Related Classes of util.Currency

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.