You are viewing a single comment's thread. Return to all comments →
import java.util.; import java.text.;
public class Solution {
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double payment = scanner.nextDouble(); scanner.close(); // Write your code here. NumberFormat usnf = NumberFormat.getCurrencyInstance(Locale.US); NumberFormat innf = NumberFormat.getCurrencyInstance(new Locale("en", "IN")); NumberFormat chinf = NumberFormat.getCurrencyInstance(Locale.CHINA); NumberFormat frnf = NumberFormat.getCurrencyInstance(Locale.FRANCE); System.out.println("US: " + usnf.format(payment)); System.out.println("India: " + innf.format(payment)); System.out.println("China: " + chinf.format(payment)); System.out.println("France: " + frnf.format(payment)); }
}
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 →
import java.util.; import java.text.;
public class Solution {
}