“GetCurrencyInstance Java Exemple” Réponses codées

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 Exemple

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

Réponses similaires à “GetCurrencyInstance Java Exemple”

Questions similaires à “GetCurrencyInstance Java Exemple”

Plus de réponses similaires à “GetCurrencyInstance Java Exemple” dans Java

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code