-
Notifications
You must be signed in to change notification settings - Fork 138
/
Solution.java
28 lines (25 loc) · 1000 Bytes
/
Solution.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
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) {
NumberFormat formatter;
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
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);
}
}