fetch currency value based on country format.

I need to fetch currency value based on  different country formats


India  : 100325.00

US Format - 1,234,567.89
German Format - 1.234.567,89
 French Format - 1 234 567,89.

how can i achieve this using java.


Find the workable code below,

package com.test.code;

import java.text.NumberFormat;
import java.util.Locale;

public class CountryFormatter {
    public static String formatCurrency(double amount, Locale countryCode) {
        NumberFormat formatter = NumberFormat.getCurrencyInstance(countryCode);
        return formatter.format(amount);
    public static void main(String[] args) {
        System.out.println(formatCurrency( 100325.00 ,new Locale("en", "IN")));
//You just need to pass the amount with the required country code

Result : Rs.100,325.00

Answer is