forked from sknsht/HackerRank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
21 lines (17 loc) · 784 Bytes
/
Solution.java
File metadata and controls
21 lines (17 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
NumberFormat us = NumberFormat.getCurrencyInstance(Locale.US);
NumberFormat in = NumberFormat.getCurrencyInstance(new Locale("en", "IN"));
NumberFormat ch = NumberFormat.getCurrencyInstance(Locale.CHINA);
NumberFormat fr = NumberFormat.getCurrencyInstance(Locale.FRANCE);
System.out.println("US: " + us.format(payment));
System.out.println("India: " + in.format(payment));
System.out.println("China: " + ch.format(payment));
System.out.println("France: " + fr.format(payment));
}
}