“GetCurrencyInstance Java Beispiel” Code-Antworten

GetCurrencyInstance Java India

float amount = 100000;

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

 String moneyString = formatter.format(amount);

 System.out.println(moneyString);
Inna Kim

GetCurrencyInstance Java Beispiel

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);
Ghaith Alzin

Ähnliche Antworten wie “GetCurrencyInstance Java Beispiel”

Fragen ähnlich wie “GetCurrencyInstance Java Beispiel”

Weitere verwandte Antworten zu “GetCurrencyInstance Java Beispiel” auf Java

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen