-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCurrencyFormater.java
29 lines (24 loc) · 960 Bytes
/
CurrencyFormater.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
NumberFormat u = NumberFormat.getCurrencyInstance(Locale.US);
NumberFormat i = NumberFormat.getCurrencyInstance(new Locale("en","in"));
NumberFormat c = NumberFormat.getCurrencyInstance(Locale.CHINA);
NumberFormat f = NumberFormat.getCurrencyInstance(Locale.FRANCE);
String us = u.format(payment);
String india = i.format(payment);
String china = c.format(payment);
String france = f.format(payment);
System.out.println("US: " + us);
System.out.println("India: " + india);
System.out.println("China: " + china);
System.out.println("France: " + france);
}
}