Java Currency Formatter

Sort by

recency

|

861 Discussions

|

  • + 1 comment

    I really had a hard time solving this problem, really. In the end the simple solution was changing java 15 jdk for jdk8 or jdk7. (:

  • + 0 comments

    Locale us = Locale.US; Locale india = new Locale("en", "IN"); Locale china = Locale.CHINA; Locale france = Locale.FRANCE;
    String usFormatted = NumberFormat.getCurrencyInstance(us).format(payment); String indiaFormatted = NumberFormat.getCurrencyInstance(india).format(payment); String chinaFormatted = NumberFormat.getCurrencyInstance(china).format(payment); String franceFormatted = NumberFormat.getCurrencyInstance(france).format(payment); System.out.println("US: " + usFormatted); System.out.println("India: " + indiaFormatted); System.out.println("China: " + chinaFormatted); System.out.println("France: " + franceFormatted);

  • + 0 comments

    Here is Java Currency Formatter solution - https://programmingoneonone.com/hackerrank-java-currency-formatter-problem-solution.html

  • + 3 comments

    Can't pass the tests due to an ascii code "ï¿¥" in expected results

  • + 0 comments

    This is a great exercise to practice working with NumberFormat and Locale in Java. It's interesting to see how currency formatting differs across countries. Cricbet99 Login