You are viewing a single comment's thread. Return to all comments →
I was able to solve this fairly easily but it required online help.
Scanner scanner = new Scanner(System.in); double payment = scanner.nextDouble(); scanner.close(); // Write your code here. String us = NumberFormat.getCurrencyInstance(Locale.US).format(payment); String india = NumberFormat.getCurrencyInstance(new Locale("EN", "IN")).format(payment); String china = NumberFormat.getCurrencyInstance(Locale.CHINA).format(payment); String france = NumberFormat.getCurrencyInstance(Locale.FRANCE).format(payment); String bangladesh = NumberFormat.getCurrencyInstance(new Locale("EN", "BD")).format(payment); System.out.println("US: " + us); System.out.println("India: " + india); System.out.println("China: " + china); System.out.println("France: " + france); // System.out.println("Bangladesh: " + bangladesh);
Seems like cookies are disabled on this browser, please enable them to open this website
Java Currency Formatter
You are viewing a single comment's thread. Return to all comments →
I was able to solve this fairly easily but it required online help.