Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

getcurrencyinstance java india

float amount = 100000;

 NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "IN"));

 String moneyString = formatter.format(amount);

 System.out.println(moneyString);
Comment

getcurrencyinstance java example

Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
        
        // Write your code here.
NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.US);
String us = formatter.format(payment);
        
formatter = NumberFormat.getCurrencyInstance(new Locale("en", "IN"));
String india = formatter.format(payment);
        
formatter = NumberFormat.getCurrencyInstance(Locale.CHINA);
String china = formatter.format(payment);
        
formatter = NumberFormat.getCurrencyInstance(Locale.FRANCE);
String france = formatter.format(payment);
        
System.out.println("US: " + us);
System.out.println("India: " + india);
System.out.println("China: " + china);
System.out.println("France: " + france);
Comment

PREVIOUS NEXT
Code Example
Java :: print float number with only four places after the decimal point in java 
Java :: multiple type array java 
Java :: return the maximum sum of two numbers whose digits add up to an equal sum 
Java :: core java tutorial 
Java :: arraylist items into string 
Java :: how to initialize bigdecimal in java 
Java :: java loop over string 
Java :: java spring boot json deserialize date inaccurate 
Java :: implementing iterator for linked list java 
Java :: print an array java 
Java :: get the max value from arrayList java and save it in int 
Java :: How to determine whether a graph contains a cycle, in Java? 
Java :: next greater permutation leetcode 
Java :: java get random 
Java :: Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: plugins.flutter.io/webview 
Java :: javafx text wrapping 
Java :: remove first and last character from string in java 
Java :: java arraylist deepcopy 
Java :: Difference between Public, Private and Protected modifier in Java? 
Java :: formula to calculate area of a triangle java 
Java :: enum set in java 
Java :: spring swagger 
Java :: matrice java 
Java :: java sum of array elements 
Java :: list of numbers java 
Java :: java class name to string 
Java :: start async task android 
Java :: java add elements array 
Java :: java sample code 
Java :: tomcat 9 default username and password 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =