Displaying Currency in Indian Numbering Format

indian currency format in php
how to get indian currency symbol in java
convert number to words in indian rupees in java
java currency format pattern
indian currency format in javascript
indian currency format in jstl
indian currency format in jasper report
number to indian currency

I have a question about formatting the Rupee currency (Indian Rupee - INR).

Typically a value like 450500 is formatted and shown as 450,500. In India, the same value is displayed as 4,50,500

For example, numbers here are represented as:

1
10
100
1,000
10,000
1,00,000
10,00,000
1,00,00,000
10,00,00,000

Refer Indian Numbering System

The separators are after two digits, except for the last set, which is in thousands.

I've searched on the internet and people have asked to use the locale en_GB or pattern #,##,##,##,##0.00

I tried this on JSTL by using the following tag:

<fmt:formatNumber value="${product.price}" type="currency" 
  pattern="#,##,##,##,###.00"/>

But this does not seem to solve the issue. Any help in this matter will be greatly appreciated.

Thanks

Unfortunately DecimalFormat doesn't support variable-width groups. So it won't ever format the values exactly as you want to:

If you supply a pattern with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####".

Most number formatting mechanisms in Java are based on that class and therefore inherit this flaw.

ICU4J (the Java version of the International Components for Unicode) provides a NumberFormat class that does support this formatting:

Format format = com.ibm.icu.text.NumberFormat.getCurrencyInstance(new Locale("en", "in"));
System.out.println(format.format(new BigDecimal("100000000")));

This code will produce this output:

Rs 10,00,00,000.00

Note: the com.ibm.icu.text.NumberFormat class does not extend the java.text.NumberFormat class (because it already extends an ICU-internal base class), it does however extend the java.text.Format class, which has the format(Object) method.

NumberFormat (Java Platform SE 7 ), Indian Currency Formatting, Number Formatting in Excel Today we will learn how to format numbers and amounts in Indian currency format. Displaying Currency in Indian Numbering Format. Crystal report Sometimes We need to show Values fields as Custom Currency format, in that Situation. right click on the field you want to change and go to format field ,in a Common Tab- Display String write a formula. TOTEXT (CURRENTFIELDVALUE,”#,##,##,##,##0.00″) For Multiple Currencies Please use if condition.

With Android, this worked for me:

new DecimalFormat("##,##,##0").format(amount);

450500 gets formatted as 4,50,500

http://developer.android.com/reference/java/text/DecimalFormat.html - DecimalFormat supports two grouping sizes - the primary grouping size, and one used for all others.

How do you put a comma in numbers in Indian style? To display numbers in Indian currency format, use the following custom number format. [>=10000000]##\,##\,##\,##0.00; [>=100000]##\,##\,##0.00;##,##0.00. ← Sum highest n numbers based on conditions. Validate cell to accept current time →.

here is simple thing u can do ,

 float amount = 100000;

 NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("en", "IN"));

 String moneyString = formatter.format(amount);

 System.out.println(moneyString);

The output will be Rs.100,000.00.

Some currency systems require a slightly different comma schema. With data like: enter image description here. applying this Custom Number Format: Today we will learn how to format numbers and amounts in Indian currency format. Indian numbers are grouped differently than standard English numbers. for eg. a number like 123456789.01 will be grouped like 123,456,789.01 in standard English notation where as the same number is grouped like 12,34,56,789.01 in Indian notation.

I also got myself in same problem. I was working with DecimalFormat.

I have no knowledge of JSTL but you can figure out something by my solution.

As, grouping size remains constant in DecimalFormat. I separated both parts, formatted them with different patterns and concat both. Here is the code.

public static String format(double value) {
    if(value < 1000) {
        return format("###", value);
    } else {
        double hundreds = value % 1000;
        int other = (int) (value / 1000);
        return format(",##", other) + ',' + format("000", hundreds);
    }
}

private static String format(String pattern, Object value) {
    return new DecimalFormat(pattern).format(value);
}

It will provide format like Indian Numbering System.

If you want decimal points, just add ".##" in both conditions.

"###" to "###.##" and "000" to "000.##".

I want to print the data like india rupees. ie 1,55250 Actually i am using the class name as But now i am using my own class and print the data my custom format. So if Print out a number using the localized number, integer, currency, When I am displaying Currency values as output , those are displaying in U.S. format (ie.1,234,000.00) , But I need to display those in Indian Rupee format (i.e 12,34,000.00). Plz any one can help me that how to display this. thank you, regards. Hanuma

The simple solution is -

Double amount = 5356673553123.0; //amount is an example ,can be used with any double value

**DecimalFormat IndianCurrencyFormat = new DecimalFormat("##,##,###.00");**

then use it as -

String formattedAmount = IndianCurrencyFormat.format(amount);

Crystal report Sometimes We need to show Values fields as Custom Currency format, in that Situation. right click on the field you want to  Hi All, I want to display a number in Indian currency format. Ex: 99999999.00 like 9,99,99,999.00 anyone please help me regarding this issue. Thanks in advance.

I have a question about formatting the Rupee currency (Indian Rupee - INR). Typically a value like 450500 is formatted and shown as 450,500. In India, the  Given a number to below function, it returns formatted number in Indian format of digit grouping. ex: input: 12345678567545.122343. output: 1,23,45,67,85,67,545.122343.

How to display Currency in Indian Numbering Format in PHP (e.g. Rs. 3,00,​00,000)?. Please add this code to your MyHome Child Theme functions.php file. You can display a number with the default currency symbol by selecting the cell or range of cells, and then clicking Accounting Number Format in the Number group on the Home tab. (If you want to apply the Currency format instead, select the cells, and press Ctrl+Shift+$.)

Currency formatting, i.e., the formatting of monetary values, combines a number with a suitable display symbol or name for  04 Display currency in indian numbering format using php Hi in this post i am showing you how to convert the number in Indian money format with PHP. Whenever we using the currency in our PHP application, the formatting of currency is very important.

Comments
  • stackoverflow.com/questions/2544454/… here you can find the answer
  • I wonder, how many times has it been asked on good old forums.sun.com? Almost daily, isn't it? ;)
  • I wanted to use it my Android App, but what is worrying me is that Jar file size is 9MB. My app currently is of size 2.5 MB, so adding 9MB to it seems like overkill
  • try using new DecimalFormat("₹ ##,##,##1");
  • @WandMaker For Android DecimalFormat seems to work. Look at Kiran's answer below.
  • Solution given by @CleanX is better. Uses the inbuild Java libraries
  • It gives me "450,501" which is not the right answer!
  • Surprisingly it's working in android and not in Java 8. Don't know why. Isn't it Java :D
  • @Heisenberg Yes it works in Android. Tried this ##,##,###.##
  • I have searched for above in golang I got this library github.com/punithck/indianmoney
  • But this is not what OP wants. He wants 1,00,000
  • This code has a huge bug. If you input 1999.95, it'll format it as 1,1000
  • this does not work with decimals.