简体   繁体   中英

How to print currency with comma as in Indian format (eg: 3,20,000)

I am printing currency with comma as in Indian format (eg: 3,20,000) for Ex. 320000 this is my amount but i want to print in 3,20,000 this format in Crystal Report. What is the setting for view this amount in this format. Thanx in Advanced

Here is the extension method i wrote when working on my project

public static CultureInfo EnglishIndia = new CultureInfo("en-IN");
//To use the rupee symbol please change "en-IN" to "hi-IN"

public static String ToLocalFormat(this decimal value)
{
    return string.Format(Constants.EnglishIndia, "{0:#,0.00}", value);
}

To use it

decimal amount = 100000;
var decimal_as_string = amount.ToLocalFormat();

You can do it with CultureInfo class.

This is how you do it:

CultureInfo india = new CultureInfo("hi-IN");
string text = string.Format(india , "{0:c}", "320000"); // ₹ 3,20,000 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM