Amount 2000
12%basic textbox1
in the textbox1 i want to calculate 12% of basic from 2000.please send the code.
Regards,
RAO.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kunal VaishyaPosted Jul 11, 2012, 9:31 AM
VulpesPosted Jul 11, 2012, 4:27 AM
(12/100)
However, if you change the line to this then it will work OK:
Kunal VaishyaPosted Jul 11, 2012, 4:22 AM
double dbamount = 2000;
TextBox.Text = ((12/100)*dbamount).ToString();
Satyapriya NayakPosted Jul 11, 2012, 4:21 AM
int a, b;
a = Convert.ToInt32(textBox1.Text);
b = Convert.ToInt32(0.12 * a);
textBox2.Text = b.ToString();
or
double a, b;
a = Convert.ToDouble(textBox1.Text);
b = Convert.ToDouble(0.12 * a);
textBox2.Text = b.ToString();
Thanks
VulpesPosted Jul 11, 2012, 4:06 AM