Skip to content

Commit b0d1aec

Browse files
authored
Create InternalizationCurrency.java
1 parent e7dd580 commit b0d1aec

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

InternalizationCurrency.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// internationalalozimg of currency
2+
import java.text.NumberFormat;
3+
import java.util.*;
4+
public class InternalizationCurrency {
5+
6+
static void printCurrency(Locale locale){
7+
double dbl=10500.3245;
8+
NumberFormat formatter=NumberFormat.getCurrencyInstance(locale);
9+
String currency=formatter.format(dbl);
10+
System.out.println(currency+" for the locale "+locale);
11+
}
12+
13+
public static void main(String[] args) {
14+
printCurrency(Locale.UK);
15+
printCurrency(Locale.US);
16+
printCurrency(Locale.FRANCE);
17+
}
18+
}

0 commit comments

Comments
 (0)