Asil Eris
Asil Eris

Reputation: 31

Rounding asp.net chart series values

I have below code

DataTable dt = new DataTable();
Chart1.Series["Available_Capacity(QTY)"].YValueMembers = Convert.ToString(dt.Columns[0]);
series.LabelFormat = "{0:#,#}";

The result is 1.671.197 however i would like to have 1,671

Upvotes: 0

Views: 577

Answers (1)

Icarus
Icarus

Reputation: 63956

Try series.LabelFormat = "{0:N0}";

BTW: you are not rounding, you are truncating, according to the desired output you said you wanted.

The {0:N0} format is simply discarding any decimal values. For example, to only get 2 decimal values, you'd do: {0:N2}

Upvotes: 2

Related Questions