When input is float or Decimal then output is in Round Off

Sabarimahesh
Posted by Sabarimahesh under C# category on | Points: 40 | Views : 1523
 float f1 = Convert.ToSingle(textBox3.Text.ToString());
int r = (int)(f1 + 0.5f);
textBox4.Text = r.ToString();

Comments or Responses

Login to post response