-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberFormate.java
More file actions
30 lines (22 loc) · 1.02 KB
/
Copy pathNumberFormate.java
File metadata and controls
30 lines (22 loc) · 1.02 KB
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.util.*;
import java.text.*;
public class NumberFormate {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
NumberFormat usFormat = NumberFormat.getCurrencyInstance(Locale.US);
String us = usFormaldt.format(payment);
NumberFormat cFormat = NumberFormat.getCurrencyInstance(Locale.CHINA);
String china = cFormat.format(payment);
Locale indiaLocale = new Locale( "en", "IN");
NumberFormat indiaFormat = NumberFormat.getCurrencyInstance(indiaLocale);
String india = indiaFormat.format(payment);
NumberFormat franceFormat=NumberFormat.getCurrencyInstance(Locale.FRANCE);
String france = franceFormat.format(payment);
System.out.println("US: " + us);
System.out.println("India: " + india);
System.out.println("China: " + china);
System.out.println("France: " + france);
}
}