You are viewing a single comment's thread. Return to all comments →
Be all aware that new Locale("en", "in") will return Rs. only on Java 8. Further versions return ₹.
new Locale("en", "in")
A workaround for Java 15 might be something like:
NumberFormat rsRupeeNumberFormat = NumberFormat.getCurrencyInstance(); DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs.setCurrencySymbol("Rs."); dfs.setGroupingSeparator('.'); dfs.setMonetaryDecimalSeparator('.'); ((DecimalFormat) rsRupeeNumberFormat).setDecimalFormatSymbols(dfs); System.out.printf("India: %s%n", rsRupeeNumberFormat.format(payment));
Seems like cookies are disabled on this browser, please enable them to open this website
Java Currency Formatter
You are viewing a single comment's thread. Return to all comments →
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: