amount calculation
some error occured:reason..i dn't now to input get dropdown
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.
PradeepPosted Mar 6, 2015, 12:35 AM
protected void Button1_Click(object sender, EventArgs e)
{
lblamtwrd.Text = "";
string[] Ones = new string[] { "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" };
string[] Twos = new string[] { "", "Eleven", "Twolve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Ninteen" };
string[] Tens = new string[] { "", "Ten", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninty" };
int Crore = Convert.ToInt32(ddlCrore.SelectedValue);
txtamt.Text = Convert.ToString(Crore * 10000000);
int Onesdigit = 0;
int tensDigit = 0;
string StrCre = "";
string StrLcs = "";
string StrThsnd = "";
if (Crore > 19 || Crore == 10)
{
Onesdigit = Crore % 10;
tensDigit = Crore / 10;
StrCre = Tens[tensDigit] + " " + Ones[Onesdigit] + " Crore ";
}
else if (Crore > 10 && Crore < 20)
{
Onesdigit = Crore % 10;
StrCre = Twos[Onesdigit] + " Crore ";
}
else if (Crore < 10)
{
StrCre = Ones[Crore] + " Crore ";
}
int Lacs = Convert.ToInt32(ddlLacs.SelectedValue);
txtamt.Text = Convert.ToString(Convert.ToInt32(txtamt.Text) + (Lacs * 100000));
if (Lacs > 19 || Lacs==10 )
{
Onesdigit = Lacs % 10;
tensDigit = Lacs / 10;
StrLcs = Tens[tensDigit] + " " + Ones[Onesdigit] + " Lacs ";
}
else if (Lacs > 10 && Lacs < 20)
{
Onesdigit = Lacs % 10;
StrLcs = Twos[Onesdigit] + " Lacs ";
}
else
{
StrLcs = Ones[Lacs] + " Lacs ";
}
int Thsnds = Convert.ToInt32(ddlTsnd.SelectedValue);
txtamt.Text = Convert.ToString(Convert.ToInt32(txtamt.Text) + (Thsnds * 1000));
if (Thsnds > 19 || Thsnds == 10)
{
Onesdigit = Thsnds % 10;
tensDigit = Thsnds / 10;
StrThsnd = Tens[tensDigit] + " " + Ones[Onesdigit] + " Thousands ";
}
else if (Thsnds > 10 && Thsnds < 20)
{
Onesdigit = Thsnds % 10;
StrThsnd = Twos[Onesdigit] + " Thousands ";
}
else
{
StrThsnd = Ones[Thsnds] + " Thousands ";
}
lblamtwrd.Text = StrCre + " " + StrLcs + " " + StrThsnd;
}
venky nPosted Mar 7, 2015, 2:05 AM
VulpesPosted Mar 3, 2015, 6:08 AM
protected void ddcroes_SelectedIndexChanged(object sender, EventArgs e)
{
Total();
}
protected void ddlaks_SelectedIndexChanged(object sender, EventArgs e)
{
Total();
}
protected void ddths_SelectedIndexChanged(object sender, EventArgs e)
{
Total();
}
public static void Total()
{
int n, n1, n2;
int.TryParse(ddcroes.SelectedItem.Text, out n);
n *= 10000000;
int.TryParse(ddlaks.SelectedItem.Text, out n1);
n1 *= 100000;
int.TryParse(ddths.SelectedItem.Text, out n2);
n2 *= 1000;
int inputNumber = n + n1 + n2;
lblWords.Text = NumbersToWords(inputNumber);
}
venky nPosted Mar 3, 2015, 5:50 AM
protected void ddcroes_SelectedIndexChanged(object sender, EventArgs e)
Anil KumarPosted Mar 3, 2015, 5:36 AM