13,558,486 members
alternative version

#### Stats

159.2K views
32 bookmarked
Posted 19 Feb 2008
Licenced CPOL

# Convert Number to Word

, 19 Feb 2008
Convert any decimal number to word using vb.net

## Introduction

I have created this function for converting amount in Indian Rupees (INR). You can manipulate as you wish like decimal setting, Doller (any currency) Prefix.

## Background

I have coded this function as per client's requirement to print word format of Billed Amount.

## Using the code

This two dimensional array store the primary word convertion of number.

``` Function retWord(ByVal Num As Decimal) As String
'This two dimensional array store the primary word convertion of number.
retWord = ""
Dim ArrWordList(,) As Object = {{0, ""}, {1, "One"}, {2, "Two"}, {3, "Three"}, {4, "Four"}, _
{5, "Five"}, {6, "Six"}, {7, "Seven"}, {8, "Eight"}, {9, "Nine"}, _
{10, "Ten"}, {11, "Eleven"}, {12, "Twelve"}, {13, "Thirteen"}, {14, "Fourteen"}, _
{15, "Fifteen"}, {16, "Sixteen"}, {17, "Seventeen"}, {18, "Eighteen"}, {19, "Nineteen"}, _
{20, "Twenty"}, {30, "Thirty"}, {40, "Forty"}, {50, "Fifty"}, {60, "Sixty"}, _
{70, "Seventy"}, {80, "Eighty"}, {90, "Ninety"}, {100, "Hundred"}, {1000, "Thousand"}, _
{100000, "Lakh"}, {10000000, "Crore"}}

Dim i As Integer
For i = 0 To UBound(ArrWordList)
If Num = ArrWordList(i, 0) Then
retWord = ArrWordList(i, 1)
Exit For
End If
Next
Return retWord
End Function
```

## About the Author

 Software Developer (Senior) India
Pranav Patel
B.Sc, MCSD

I am serving my company as Sr. Software Engineer. I have more than 4 years of experience in Microsoft Technologies specially VB 6, VB.Net,C#,ASP.Net and MS SQL Server

## Comments and Discussions

 thanks Ram A Singh14-Aug-13 6:50 Ram A Singh 14-Aug-13 6:50
 It never converts zeros JAYANTHIMURUGESAN26-Mar-13 14:33 JAYANTHIMURUGESAN 26-Mar-13 14:33
 Thanks taenel l pasaylo27-Jan-13 1:27 taenel l pasaylo 27-Jan-13 1:27
 Not perfect alifaris5-Nov-12 8:36 alifaris 5-Nov-12 8:36
 project rahul binaikia29-May-12 4:58 rahul binaikia 29-May-12 4:58
 Thanks !!! Member 340016411-May-12 15:17 Member 3400164 11-May-12 15:17
 My vote of 5 Jack_32122-Apr-12 23:38 Jack_321 22-Apr-12 23:38
 Thanks Member 850926513-Mar-12 19:09 Member 8509265 13-Mar-12 19:09
 My vote of 4 Md. Marufuzzaman2-Jan-12 19:22 Md. Marufuzzaman 2-Jan-12 19:22
 My vote of 5 Аslam Iqbal26-Dec-11 20:43 Аslam Iqbal 26-Dec-11 20:43
 Nice Work maruf2111-Dec-11 12:17 maruf21 11-Dec-11 12:17
 My vote of 1 Member 846869111-Dec-11 4:16 Member 8468691 11-Dec-11 4:16
 My vote of 1 divyanivas18-Aug-11 9:10 divyanivas 18-Aug-11 9:10
 How do increase to more than 999999999.99 Deepesh Krishnan29-Apr-11 19:50 Deepesh Krishnan 29-Apr-11 19:50
 My vote of 5 CodeDog13-Apr-11 4:58 CodeDog 13-Apr-11 4:58
 My vote of 1 yogeshd3918-Feb-11 1:23 yogeshd39 18-Feb-11 1:23
 Good Article but with alot of limitations Albert Dadze17-Dec-10 6:00 Albert Dadze 17-Dec-10 6:00
 My vote of 3 Ashwani2k12-Jul-10 8:14 Ashwani2k 12-Jul-10 8:14
 Usefull Work Vimal Upadhyay16-May-10 22:43 Vimal Upadhyay 16-May-10 22:43
 Thanks hrivero23-Mar-10 9:35 hrivero 23-Mar-10 9:35
 My vote of 1 geminiousgoel26-Jan-10 5:45 geminiousgoel 26-Jan-10 5:45
 C# Code please yeswanths4-May-09 4:36 yeswanths 4-May-09 4:36
 Re: C# Code please - Working upto 999999999.99 Member 468636426-Nov-09 0:09 Member 4686364 26-Nov-09 0:09
 Thanks a lot rajakar0123-Dec-08 19:00 rajakar01 23-Dec-08 19:00
 Try One million and above sensei41200131-Aug-08 22:20 sensei412001 31-Aug-08 22:20
 Last Visit: 31-Dec-99 18:00     Last Update: 26-May-18 6:27 Refresh 12 Next »

General    News    Suggestion    Question    Bug    Answer    Joke    Praise    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.