We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java Currency Formatter
Java Currency Formatter
Sort by
recency
|
766 Discussions
|
Please Login in order to post a comment
Be all aware that
new Locale("en", "in")
will return Rs. only on Java 8. Further versions return ₹.A workaround for Java 15 might be something like:
import java.io.; import java.util.; import java.text.NumberFormat; import java.util.Locale;
public class Solution {
}
I tried everything, it won't work
import java.io.; 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();
} }
Wrong Answer
Input (stdin) 12324.134
Your Output (stdout)
US: $12,324.13 India: Rs.12,324.13 China: ¥12,324.13 France: 12 324,13 €
Expected Output
US: $12,324.13 India: Rs.12,324.13 China: ¥12,324.13 France: 12 324,13 €