13,085,613 members (103,562 online)
Rate this:
See more:
Dear All
I am working with the finance firm in which i need to display the deal amount in words also .this i am not able to do need Help to resolve this issue for this issue ....
Pratham
Posted 26-Jun-12 1:39am
Vani Kulkarni 3-Jul-12 3:00am

What is the issue you are facing?

Rate this:

## Solution 1

hi pratham..
this works fine from 1 to 19999, once go throw it..

```using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace tryingstartfror4digits
{
class Program
{
static void Main(string[] args)
{
Program pg=new Program();
Console.WriteLine("Enter ur number");
if (num <= 19)
{
string g = pg.first(num);
Console.WriteLine("The number is " + g);
}
else if ((num >= 20) && (num <= 99))
{
if (num % 10 == 0)
{
string g = pg.second(num / 10);
Console.WriteLine("The number is " + g);
}
else
{
string g = pg.second(num / 10) + pg.first(num % 10);
Console.WriteLine("The number is " + g);
}
}
else if((num>=100) && (num<=999))
{
int k = num % 100;
string g = pg.first(num / 100) +pg.third(0) + pg.second(k / 10)+pg.first(k%10);
Console.WriteLine("The number is " + g);
}
else if ((num >= 1000) && (num <= 19999))
{
int h=num%1000;
int k=h%100;
string g = pg.first(num / 1000) + "Thousand " + pg.first(h/ 100) + pg.third(k) + pg.second(k / 10) + pg.first(k % 10);
Console.WriteLine("The number is " + g);
}
}
public string first(int num)
{
string name;
if (num == 0)
{
name = " ";
}
else
{
string[] arr1 = new string[] { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" , "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
name = arr1[num - 1];
}
return name;
}
public string second(int num)
{
string name;
if ((num == 0)||(num==1))
{
name = " ";
}
else
{
string[] arr1 = new string[] { "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety" };
name = arr1[num - 2];
}
return name;
}
public string third(int num)
{
string name ;
if (num == 0)
{
name = "";
}
else
{
string[] arr1 = new string[] { "Hundred" };
name = arr1[0];
}
return name;
}

}
}```

all the best...:)
pratham2587 26-Jun-12 8:04am

i want to display the numerical value from textbox in words ..
Is this code will help for that issue.
sandeep nagabhairava 26-Jun-12 8:08am

this is the code converting numerical to text format.
pratham2587 26-Jun-12 8:11am

is this code will help to convert the text box numeric value into words?
Rate this:

Rate this:

Rate this:

Rate this:

## Solution 5

Revert with the code for the same .....
Vani Kulkarni 3-Jul-12 3:00am

What is the issue you are facing?
Vani Kulkarni 3-Jul-12 3:01am

Top Experts
Last 24hrsThis month
 OriginalGriff 273 Graeme_Grant 170 Jochen Arndt 150 Kornfeld Eliyahu Peter 150 Karthik Bangalore 80
 OriginalGriff 3,055 Graeme_Grant 1,419 ProgramFOX 1,367 ppolymorphe 1,217 Jochen Arndt 1,200