Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

public class Main {
    public static String convertToCurrencyFormat(String amount) {
        double amountDouble = Double.parseDouble(amount);
        NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "IN"));
        String returnString = formatter.format(amountDouble).replace("Rs.", "");
        return returnString.replace("Rs", "").trim();
    }
}