Package util

Source Code of util.Currency

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.