Open In App

DecimalFormatSymbols setInternationalCurrencySymbol() method in Java with Examples

Last Updated : 29 Jul, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The setInternationalCurrencySymbol(String) method of java.text.DecimalFormatSymbols class in Java is used to set the ISO 4217 currency code that is used to represent the international currency symbol for the Locale of this DecimalFormatSymbols. This method takes the String for representing the international currency symbol as the parameter.

Syntax:

public void setInternationalCurrencySymbol(
            String internationalCurrencySymbol)

Parameter: This method accepts international currency symbol as a parameter which is the String that will be used to represent the international currency symbol for this DecimalFormatSymbols.

Return Value: This method do not set anything.

Exception: This method do not throw any Exception.

Program:




// Java program to demonstrate
// the above method
  
import java.text.*;
import java.util.*;
  
public class DecimalFormatSymbolsDemo {
    public static void main(String[] args)
    {
  
        DecimalFormatSymbols dfs
            = new DecimalFormatSymbols();
  
        System.out.println(
            "Current String used "
            + "for international "
            + "currency symbol: "
            + dfs.getInternationalCurrencySymbol());
  
        String internationalCurrencySymbol
            = "INR";
  
        dfs.setInternationalCurrencySymbol(
            internationalCurrencySymbol);
  
        System.out.println(
            "Updated String used "
            + "for international "
            + "currency symbol: "
            + dfs.getInternationalCurrencySymbol());
    }
}


Output:

Current String used for international currency symbol: USD
Updated String used for international currency symbol: INR

Reference: https://docs.oracle.com/javase/9/docs/api/java/text/DecimalFormatSymbols.html#setInternationalCurrencySymbol-java.lang.String-


Similar Reads

DecimalFormatSymbols getCurrency() method in Java with Examples
The getCurrency() method of java.text.DecimalFormatSymbols class in Java is used to get the currency for the Locale of this DecimalFormatSymbols. This method returns the currency. Syntax: public char getCurrency() Parameter: This method do not accept any parameter. Return Value: This method returns a currency of the DecimalFormatSymbols with the Lo
1 min read
DecimalFormatSymbols getPatternSeparator() method in Java with Examples
The getPatternSeparator() method of java.text.DecimalFormatSymbols class in Java is used to get the character that is used to represent pattern separator for the Locale of this DecimalFormatSymbols. This method returns the character used to separate positive and negative subpatterns in a pattern. Syntax: public char getPatternSeparator() Parameter:
1 min read
DecimalFormatSymbols getInstance(Locale) method in Java with Examples
The getInstance(Locale) method of java.text.DecimalFormatSymbols class in Java is used to get the DecimalFormatSymbols instance for the specified Locale. This method is final and cannot be overridden or changed. It takes the Locale for which the DecimalFormatSymbols is required, as a parameter and returns the respective instance of that DecimalForm
1 min read
DecimalFormatSymbols toString() method in Java with Examples
The toString() method of java.text.DecimalFormatSymbols class in Java is used to get the String value of this DecimalFormatSymbols. This method returns an integer representing the String value. Syntax: public String toString() Parameter: This method do not accept any parameter. Return Value: This method returns a String which is the String value of
1 min read
DecimalFormatSymbols hashCode() method in Java with Examples
The hashCode() method of java.text.DecimalFormatSymbols class in Java is used to get the hashCode value of this DecimalFormatSymbols. This method returns an integer representing the hashCode value. Syntax: public int hashCode() Parameter: This method do not accept any parameter. Return Value: This method returns an int which is the hashCode value o
1 min read
DecimalFormatSymbols equals() method in Java with Examples
The equals() method of java.text.DecimalFormatSymbols class in Java is used to check for equality of this DecimalFormatSymbols with the specified DecimalFormatSymbols. This method takes a DecimalFormatSymbols instance and compares it with this DecimalFormatSymbols and returns a boolean value representing the same. Syntax: public boolean equals(Obje
2 min read
DecimalFormatSymbols setCurrency() method in Java with Examples
The setCurrency(Currency) method of java.text.DecimalFormatSymbols class in Java is used to set the currency for the Locale of this DecimalFormatSymbols. This method takes the currency as the parameter and sets it. Syntax: public void setCurrency(Currency currency) Parameter: This method accepts the currency as a parameter which is the Currency tha
1 min read
DecimalFormatSymbols getAvailableLocales() method in Java with Examples
The getAvailableLocales() method of java.text.DecimalFormatSymbols class in Java is used to get the list of all of the available Locales for this DecimalFormatSymbols. This method returns an array of the Locales that are available. Syntax: public static Locales[] getAvailableLocales() Parameter: This method do not accept any parameter. Return Value
2 min read
DecimalFormatSymbols getMonetaryDecimalSeparator() method in Java with Examples
The getMonetaryDecimalSeparator() method of java.text.DecimalFormatSymbols class in Java is used to get the character that is used to represent monetary decimal separator for the Locale of this DecimalFormatSymbols. This method returns the character for monetary decimal separator of that Locale. Syntax: public char getMonetaryDecimalSeparator() Par
1 min read
DecimalFormatSymbols setPatternSeparator() method in Java with Examples
The setPatternSeparator(char) method of java.text.DecimalFormatSymbols class in Java is used to set the character that is used to represent pattern separator for the Locale of this DecimalFormatSymbols. This method takes the character used to separate positive and negative subpatterns in a pattern. Syntax: public void setPatternSeparator(char patte
1 min read