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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 11, 2012, 12:06 AM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 11, 2012, 12:21 AM EDT
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
Kunal VaishyaRank #990 · 2K reputationPosted Jul 11, 2012, 12:22 AM EDT
double dbamount = 2000;
TextBox.Text = ((12/100)*dbamount).ToString();
VulpesRank #55 · 29.2K reputationPosted Jul 11, 2012, 12:27 AM EDT
(12/100)
However, if you change the line to this then it will work OK:
Kunal VaishyaRank #990 · 2K reputationPosted Jul 11, 2012, 5:31 AM EDT