Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
12
Reply
formatting numbers to currency
john kanyora
Dec 15 2017 3:23 AM
336
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()`
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
12
)
Errors related to speech synthesizer
How to map fields in an object to another dynamically?