Wednesday, 19 March 2014

Universal Currency Format in C#

 public static string FormatCurrency(object currencyValue)
        {
            CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
            culture.NumberFormat.CurrencyNegativePattern = 1;
            return string.Format(culture, "{0:C}", currencyValue);
        }

No comments:

Post a Comment