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
Fadugba Jeremiah
NA
49
18.1k
converting from integer to double
Oct 28 2013 7:35 AM
please i have three textbox and datagridview. I have successfully sum up two columns and insert the result into their respective textbox but i now want to divide the two textbox which are integer and insert the result into the third textbox which should be in decimal
here is my code the problem is highlighted in blue.
private void calculate_Click(object sender, EventArgs e)
{
int sumunt = 0;
for (int i = 0; i < dataGridView1.Rows.Count; ++i)
{
sumunt += Convert.ToInt32(dataGridView1.Rows[i].Cells["crsunt"].Value);
}
totcrsunt.Text = sumunt.ToString();
int sumgp = 0;
for (int i = 0; i < dataGridView1.Rows.Count; ++i)
{
sumgp += Convert.ToInt32(dataGridView1.Rows[i].Cells["crsgp"].Value);
}
totcrsgp.Text = sumgp.ToString();
int grpnt = Convert.ToInt32(totcrsgp);
int unit = Convert.ToInt32(totcrsunt);
int cgpa = grpnt % unit;
mycgpa.Text = cgpa.ToString();
Reply
Answers (
7
)
Arrays & Enum
Update ComboBoxes When the selectedIndexChange occoured