You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner scan=new Scanner(System.in); double amt=scan.nextDouble(); System.out.println("US: "+NumberFormat.getCurrencyInstance(Locale.US).format(amt)); System.out.println("India: "+NumberFormat.getCurrencyInstance(new Locale("en","IN")).format(amt)); System.out.println("China: "+NumberFormat.getCurrencyInstance(Locale.CHINA).format(amt)); System.out.println("France: "+NumberFormat.getCurrencyInstance(Locale.FRANCE).format(amt)); } }
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 →