am having trouble formating my numbers to currency..am drawing a bar chart and i want to have the numbers in the form of currency.what am getting is just integers for example instead of getting 200.00 am getting just 200.below is my code`
string connect=TraceBizCommon.Configuration.ConfigSettings.ConnectionString;
SqlConnection conn = new SqlConnection(connect);conn.Open();
SqlCommand cmd = new SqlCommand("select substring(Customer, 1,8),[Total Amount] from CustomerDebts ", conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
string[] x = new string[dt.Rows.Count];
decimal[] y = new decimal[dt.Rows.Count];
for (int i = 0; i
{
x[i] = dt.Rows[i][0].ToString();
y[i] = Convert.ToInt32(dt.Rows[i][1]);
}
BarChart1.Series.Add(new AjaxControlToolkit.BarChartSeries { Data = y});
BarChart1.CategoriesAxis = string.Join(",", x);
BarChart1.ChartWidth =500.ToString();//(x.Length * 100).ToString();
BarChart1.ChartHeight = 600.ToString();//(y.Length * 75).ToString()`

Amit GuptaRank #190 · 12.8K reputationPosted Dec 17, 2017, 12:33 PM EST
Altaf AnsariRank #1,045 · 1.8K reputationPosted Dec 14, 2017, 10:39 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 14, 2017, 10:44 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Dec 14, 2017, 10:47 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 14, 2017, 10:55 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Dec 15, 2017, 10:52 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 17, 2017, 5:01 AM EST
Posted Dec 17, 2017, 6:30 AM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 17, 2017, 9:14 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Dec 17, 2017, 9:19 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Dec 17, 2017, 9:31 PM EST
Rafnas T PRank #280 · 8.8K reputationPosted Dec 15, 2017, 7:09 PM EST