Number to Word Converter

Our Free Number to Word Converter is a Simple and Easy to use code that will help you in Currency Settings, Human readable, and any places.

This code should be maintained in a form as per the following methodolody,

The Code:

Method to Call is: numToWord(5500)

Method to load while Initialization:
Private Sub initGlobal()
sNumbers(0) = “”
sNumbers(1) = “One”
sNumbers(2) = “Two”
sNumbers(3) = “Three”
sNumbers(4) = “Four”
sNumbers(5) = “Five”
sNumbers(6) = “Six”
sNumbers(7) = “Seven”
sNumbers(8) = “Eight”
sNumbers(9) = “Nine”
sNumbers(10) = “Ten”
sNumbers(11) = “Eleven”
sNumbers(12) = “Twelve”
sNumbers(13) = “Thirteen”
sNumbers(14) = “Fourteen”
sNumbers(15) = “Fifteen”
sNumbers(16) = “Sixteen”
sNumbers(17) = “Seventeen”
sNumbers(18) = “Eighteen”
sNumbers(19) = “Nineteen”
sNumbers(20) = “Twenty”
sNumbers(21) = “Thirty”
sNumbers(22) = “Fourty”
sNumbers(23) = “Fifty”
sNumbers(24) = “Sixty”
sNumbers(25) = “Seventy”
sNumbers(26) = “Eighty”
sNumbers(27) = “Ninety”
End Sub
Other Subroutine to be used while Converting:

Private Function numToWord(cNum As Long) As String
Dim numLen As Integer
Dim numText As String
numText = “”
numLen = Len(Trim(cNum))
Select Case numLen
Case 1
‘for single digit
curNum = Mid$(cNum, 1, 1)
numText = sNumbers(curNum)
Case 2
‘for 10 to 99
numText = twoDigit(cNum)
Case 3
‘for 100 to 999 (hundred)
‘curNum = Mid$(cNum, 1, 1)
numText = getHundred(cNum)
Case 4
‘for 1000 to 9999 (thousand)
numText = sNumbers(Mid$(cNum, 1, 1)) & ” thousand ” & getHundred(Mid$(cNum, 2))
Case 5
‘for 10000 to 99999 (thousands)
numText = twoDigit(Mid$(cNum, 1, 2)) & ” thousand ” & _
getHundred(Mid$(cNum, 3))
Case 6
‘for 100000 to 999999 (lakh)
numText = sNumbers(Mid$(cNum, 1, 1)) & ” lakh ” & _
getThousand(Mid$(cNum, 2))
Case 7
‘for 1000000 to 9999999 (lakhs)
numText = twoDigit(Mid$(cNum, 1, 2)) & ” lakh ” & _
getThousand(Mid$(cNum, 3))
Case 8
‘for 10000000 to 99999999 (crore)
If (Mid$(cNum, 2) <= 0) Then
numText = sNumbers(Mid$(cNum, 1, 1)) & ” crore”
Else
numText = sNumbers(Mid$(cNum, 1, 1)) & ” crore” & _
twoDigit(Mid$(cNum, 2, 2)) & ” lakh ” & getThousand(Mid$(cNum, 4))
End If
End Select
numToWord = numText
End Function
Private Function twoDigit(num As Long) As String
If num < 20 Then
twoDigit = sNumbers(num)
Else
sText = sNumbers(Mid$(num, 1, 1) + 18)
If Not (Mid$(num, 2, 1) = 0) Then
sText = sText & ” ” & sNumbers(Mid$(num, 2, 1))
End If
twoDigit = sText
End If
End Function

Private Function getHundred(num As Long) As String
sText = “”
If num > 0 Then
If num < 100 Then
sText = ” and ” & twoDigit(num)
Else
sText = sNumbers(Mid$(num, 1, 1)) & ” hundred”
If Mid$(num, 2) > 0 Then
sText = sText & ” and ” & twoDigit(Mid$(num, 2))
End If
End If
End If
getHundred = sText
End Function
Private Function getThousand(num As Long) As String
sText = “”
If num > 0 Then
If num < 1000 Then
sText = getHundred(num)
Else
sText = twoDigit(Mid$(num, 1, 2)) & ” thousand ”
If Not (Mid$(num, 3) <= 0) Then
sText = sText & getHundred(Mid$(num, 3))
End If
End If
End If
getThousand = sText
End Function

Usage:

The above VB Code should be placed in a FORM or Class Module to become available to use.

to convert a Number to Human Readable Word (String)

Call the method numToWord(argumernt)

The argument should be Integer Value.

Note: you may freely use/distribute this code anywhere you want. There is no copy protected restriction for my own code.

By apsam29 on October 14, 2009 | Visual Basic
Tags: ,

vCard Creator

The vCard (Business Card) 2.0 is a Online Visiting Card Creator freely available to download in this website.

The main features focused in vcard creator are:

purely based on vCard version 2.0.

Developed with Open source language – PHP.

Object Oriented Support.

Supports most of the vCard features like, adding Address, Birthday, Labeling, Notes, Email, Web URL and More.

Free Download of this vCard2

By apsam29 on October 13, 2009 | PHP
Tags:

WAP Email Inviter

Free WAP(Wireless Application Protocol) 2.0 Inviter is a Email Invitation Sender for mobile websites which using XHTML MP profile.
Inviter Features:
Use your Own Email Id to Send Invitations.

Optimized Error Handling.

Send Multiple Mails at a Time.

Run Anywhere feature.

Inline Configuration for Inviter Form.

Free Download WAP Inviter

By admin on October 4, 2009 | PHP, WAP, Wireless
Tags: , ,

PHP
Visual Basic
WAP
Wireless