How to convert numbers to equivalent words?

Jun 19 2010 4:04 PM
Hi!!!! 
how can I convert numerals into words...In textbox1 i enter numeral and on button click equivalent wordsl is displayed in another label5
for Example we enter "12034784" , 
then its corresponding words should be "One crore twenty lakh thirty four thousand seven hundred eighty four".

What will be the C# code for finding words to corresponding numerals for range 0 to 999999999 ..... 
I mean kindly give me general code applicable for all values.........
.....................:>Below i am sending my code also....

if (sMode == "view")
                {
                    // process for showing user detail to administrator

                    // write code to get user detail


                    DataTable dtViewData = null;
                    string sStatusTmp = lib.getCurrentStatus(sCompany,sLocation, sEmpCode.Trim());

                    dtViewData = lib.ViewData(sCompany, sLocation,sEmpCode);
                    if (dtViewData != null)
                    {
                        label1.Text = dtViewData.Rows[0].ItemArray[2].ToString();
                        Label2.Text = dtViewData.Rows[0].ItemArray[7].ToString();
                        TextBox1.Text = dtViewData.Rows[0].ItemArray[3].ToString();
                        label5.Text = dtViewData.Rows[0].ItemArray[4].ToString();
                        label3.Text = dtViewData.Rows[0].ItemArray[5].ToString();
                        label4.Text = dtViewData.Rows[0].ItemArray[6].ToString();
                        btnSubmit.Enabled = false;
                        TextBox1.Enabled = false;
                        label5.Enabled = false;


                    }
                }
                else
                {
                    string sStatusTmp = lib.getCurrentStatus(sCompany, sLocation, sEmpCode.Trim());
                    label1.Text = sEmpCode;
                    Label2.Text = DateTime.Now.ToShortDateString();

                    // show blank below feild to user - user will fill the feild.

                    TextBox1.Text = sexpense;
                    label5.Text = sexpensetxt;
                    DataTable dtdate = lib.getdateDetail("MCL", "RNV", sEmpCode);

                    label3.Text = dtdate.Rows[0].ItemArray[0].ToString();
                    label4.Text = dtdate.Rows[0].ItemArray[1].ToString();


                }
            }
Thanks a lot...



Answers (1)