12,549,003 members (48,376 online)
Rate this:
Please Sign up or sign in to vote.
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 ....
Thanks in advance to all....
Pratham
Posted 26-Jun-12 1:39am
Comments
Vani Kulkarni 3-Jul-12 3:00am

What is the issue you are facing?

## 5 solutions

Rate this:
Please Sign up or sign in to vote.

## 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");
int num = Convert.ToInt32(Console.ReadLine());
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);
}
Console.ReadLine();
}
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...:)
Comments
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:
Please Sign up or sign in to vote.

## Solution 2

Rate this:
Please Sign up or sign in to vote.

## Solution 3

Rate this:
Please Sign up or sign in to vote.

## Solution 4

Rate this:
Please Sign up or sign in to vote.

## Solution 5

Not able to solve the issue Please help for the same.
Revert with the code for the same .....
Comments
Vani Kulkarni 3-Jul-12 3:00am

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

This is not an answer. Please remove it from Solution list.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 Dave Kreskowiak 100 ppolymorphe 100 Suvendu Shekhar Giri 80 Rbabs 75 Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ) 60
 OriginalGriff 3,902 Suvendu Shekhar Giri 1,713 John Simmons / outlaw programmer 1,687 ppolymorphe 1,541 Karthik Bangalore 1,210

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 3 Jul 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100