“GetCurrencyInstance Java Contoh” Kode Jawaban

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 Contoh

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

Jawaban yang mirip dengan “GetCurrencyInstance Java Contoh”

Pertanyaan yang mirip dengan “GetCurrencyInstance Java Contoh”

Lebih banyak jawaban terkait untuk “GetCurrencyInstance Java Contoh” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya