Java DecimalFormat.getCurrency()

Syntax

DecimalFormat.getCurrency() has the following syntax.

public Currency getCurrency()

Example

In the following code shows how to use DecimalFormat.getCurrency() method.


/* w ww .  ja  v a2  s .c om*/
import java.text.DecimalFormat;

public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    
    System.out.println(format.getCurrency());

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat