TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
john kanyora
NA
242
46.5k
formatting numbers to currency
Dec 15 2017 3:23 AM
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
Answers (
12
)
Errors related to speech synthesizer
How to map fields in an object to another dynamically?