Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Hackerrank/java-currency-formatter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import java.util.*;
import java.text.*;


// Problem: Compare the Triplets
// URL:https://www.hackerrank.com/challenges/java-currency-formatter/problem?isFullScreen=true
// Language: Java


public class Solution {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();

// Write your code here.
String us = NumberFormat.getCurrencyInstance(Locale.US).format(payment);
String india = NumberFormat.getCurrencyInstance(new Locale("en","in")).format(payment);
String china = NumberFormat.getCurrencyInstance(Locale.CHINA).format(payment);
String france = NumberFormat.getCurrencyInstance(Locale.FRANCE).format(payment);

System.out.println("US: " + us);
System.out.println("India: " + india);
System.out.println("China: " + china);
System.out.println("France: " + france);

scanner.close();
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ In this repository, you can find the solutions (as source code) for the problems
| [Nauman Chaudhary](https://github.com/nauman-chaudhary) <br> <img src="https://github.com/nauman-chaudhary.png" width="100" height="100"> | Pakistan | Python | |
| [Gourav Rusiya](https://github.com/GouravRusiya30) <br> <img src="https://github.com/GouravRusiya30.png" width="100" height="100"> | India | Java | https://www.hackerrank.com/gouravrusiya786 |
| [Trushita Maurya](https://github.com/trushita23) <br> <img src="https://github.com/trushita23.png" width="100" height="100"> | India | Java

| [Ayan Ajmeri](https://github.com/Ayanajmeri924) <br> <img src="https://github.com/Ayanajmeri924.png" width="100" height="100"> | India | Java |

### License

[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/ows-ali/Hacktoberfest/blob/master/LICENSE)