-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcurrency.java
More file actions
25 lines (21 loc) · 857 Bytes
/
currency.java
File metadata and controls
25 lines (21 loc) · 857 Bytes
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
import java.util.*;
import java.text.*;
public class currency {
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 in=i.format(payment);
String ch=c.format(payment);
String fr=f.format(payment);
System.out.println("US: " +us );
System.out.println("India: " + in );
System.out.println("China: " + ch);
System.out.println("France: " + fr);
}
}