get USD Currency Format - Java java.lang

Java examples for java.lang:double Format

Description

get USD Currency Format

Demo Code

/**//from w w w. j a v a  2s  . c o  m
 * Created by diego.rotondale on 1/23/2015.
 * Copyright (c) 2015 AnyPresence, Inc. All rights reserved.
 */
//package com.java2s;
import java.text.NumberFormat;
import java.util.Currency;

public class Main {
    private static NumberFormat getCurrencyFormat() {
        NumberFormat format = NumberFormat.getCurrencyInstance();
        format.setCurrency(Currency.getInstance("USD"));
        return format;
    }
}

Related Tutorials