Package com.sun.ebank.web

Source Code of com.sun.ebank.web.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 com.sun.ebank.web;
import java.text.NumberFormat;
import java.text.DecimalFormat;
public final class Currency extends Object {
   public static String format(double amount){
      NumberFormat nf = NumberFormat.getCurrencyInstance();
      DecimalFormat df = (DecimalFormat)nf;
      df.setMinimumFractionDigits(2);
      df.setMaximumFractionDigits(2);
      df.setDecimalSeparatorAlwaysShown(true);
      String pattern = "$###,###.00";
      df.applyPattern(pattern);
      return df.format(amount);
   }
}
TOP

Related Classes of com.sun.ebank.web.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.