Tuesday, July 28, 2009

C# : float to currency format

Usually programmers need to format their data type to presentable currency format. Following the simple c# code to present your data in currency format like (##,###.##)

Code:

Decimal f = Convert.ToDecimal({AnyDataType});

lblValue.Text = f.ToString("C").Replace("$", "");


Regards

4Z




No comments: