Number in words
  •   private void button1_Click(object sender, EventArgs e)
            {
                string[] Ones = { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Ninteen" };
                string[] Tens = { "Ten", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninty" };
                int no = int.Parse(txtNumber.Text);
                string strWords = "";

                if (no > 9999 && no < 100000)
                {
                    int i = no / 10000;
                    strWords = strWords + Tens[i - 1] + " Thousand ";
                    no = no % 10000;
                }


                if (no > 999 && no < 10000)
                {
                    int i = no / 1000;
                    strWords = strWords + Ones[i - 1] + " Thousand ";
                    no = no % 1000;
                }


                if (no > 99 && no < 1000)
                {
                    int i = no / 100;
                    strWords = strWords + Ones[i - 1] + " Hundred ";
                    no = no % 100;
                }

                if (no > 19 && no < 100)
                {
                    int i = no / 10;
                    strWords = strWords + Tens[i - 1] + " ";
                    no = no % 10;
                }

                if (no > 0 && no < 20)
                {
                    strWords = strWords + Ones[no - 1];
                }
                label2.Text = "";
                label2.Text = label2.Text + strWords;
            }
    but i want to up to crores 
    how can i implement
    plz help me
  • 4 Comments sorted by
  • Increase your if condition and numbers as per your requirment
    do best will hope best
  • i dont know how to giv a condition plz send the code Mr. SalmanKhatri
  • Vote Up0Vote Down WaqasWaqas
    172.00 Karma Accepted Answer
    you can also get idea from my code which i done for crystal report number into words
    where i split it into
    crore
    lac
    thousand
    hundred
    and paisa too
    kindly get idea from this link

    http://codingresolved.com/discussion/259/convert-number-to-words-in-crystal-report/p1
  • Thank u waqas

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative