0

Hi
In my listview I have a column called grantotal which is of type double.Now it is displayed as 12300 but I want to display it as 12,300.
How can I do it?
Thanx in Advance

3
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by sknake
0

You need to format the string before you populate the ListView. To get the thousand separator without decimals use:

private void button2_Click(object sender, EventArgs e)
    {
      int i1 = 5555;
      Console.WriteLine(i1.ToString("N0", System.Globalization.CultureInfo.InvariantCulture));
    }
0

Use this method

double d = 1230.00;
d.toString("#,#.00");

Welcome to DaniWeb hermaljoes!

Please use code tags when posting code:

[code=csharp] ...code here...

[/code]

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.