Published on: 25 Jul, 2013

How to format currency in string using ASP.Net C#?

Tumblr Digg Google Plus

In this tutorial, you will learn how you can format a currency using string in ASP.Net C#.

There are two methods you can use to format the string into currency, please see the example format string function below:

//decimal currencyValue = 100;
string strCurrency = "";

//You can use ToString("n") 
strCurrency = currencyValue.ToString("n");

//Or alternatively you can use ToString("0.00") 
strCurrency = currencyValue.ToString("0.00");

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.