Refer below code.
Dim mNos(100) As String
Public Function changeToWords(ByVal numb As Decimal) As String
Dim mStrAmt, mChrAmt As String, amtInWords As String = ""
Dim mLenAmt, mAmt As Integer
mNos(0) = "Zero"
mNos(1) = "One"
mNos(2) = "Two"
mNos(3) = "Three"
mNos(4) = "Four"
mNos(5) = "Five"
mNos(6) = "Six"
mNos(7) = "Seven"
mNos(8) = "Eight"
mNos(9) = "Nine"
mNos(10) = "Ten"
mNos(11) = "Eleven"
mNos(12) = "Twelve"
mNos(13) = "Thirteen"
mNos(14) = "Fourteen"
mNos(15) = "Fifteen"
mNos(16) = "Sixteen"
mNos(17) = "Seventeen"
mNos(18) = "Eighteen"
mNos(19) = "Nineteen"
mNos(20) = "Twenty"
mNos(21) = "Twenty One"
mNos(22) = "Twenty Two"
mNos(23) = "Twenty Three"
mNos(24) = "Twenty Four"
mNos(25) = "Twenty Five"
mNos(26) = "Twenty Six"
mNos(27) = "Twenty Seven"
mNos(28) = "Twenty Eight"
mNos(29) = "Twenty Nine"
mNos(30) = "Thirty"
mNos(31) = "Thirty One"
mNos(32) = "Thirty Two"
mNos(33) = "Thirty Three"
mNos(34) = "Thirty Four"
mNos(35) = "Thirty Five"
mNos(36) = "Thirty Six"
mNos(37) = "Thirty Seven"
mNos(38) = "Thirty Eight"
mNos(39) = "Thirty Nine"
mNos(40) = "Forty"
mNos(41) = "Forty One"
mNos(42) = "Forty Two"
mNos(43) = "Forty Three"
mNos(44) = "Forty Four"
mNos(45) = "Forty Five"
mNos(46) = "Forty Six"
mNos(47) = "Forty Seven"
mNos(48) = "Forty Eight"
mNos(49) = "Forty Nine"
mNos(50) = "Fifty"
mNos(51) = "Fifty One"
mNos(52) = "Fifty Two"
mNos(53) = "Fifty Three"
mNos(54) = "Fifty Four"
mNos(55) = "Fifty Five"
mNos(56) = "Fifty Six"
mNos(57) = "Fifty Seven"
mNos(58) = "Fifty Eight"
mNos(59) = "Fifty Nine"
mNos(60) = "Sixty"
mNos(61) = "Sixty One"
mNos(62) = "Sixty Two"
mNos(63) = "Sixty Three"
mNos(64) = "Sixty Four"
mNos(65) = "Sixty Five"
mNos(66) = "Sixty Six"
mNos(67) = "Sixty Seven"
mNos(68) = "Sixty Eight"
mNos(69) = "Sixty Nine"
mNos(70) = "Seventy"
mNos(71) = "Seventy One"
mNos(72) = "Seventy Two"
mNos(73) = "Seventy Three"
mNos(74) = "Seventy Four"
mNos(75) = "Seventy Five"
mNos(76) = "Seventy Six"
mNos(77) = "Seventy Seven"
mNos(78) = "Seventy Eight"
mNos(79) = "Seventy Nine"
mNos(80) = "Eighty"
mNos(81) = "Eighty One"
mNos(82) = "Eighty Two"
mNos(83) = "Eighty Three"
mNos(84) = "Eighty Four"
mNos(85) = "Eighty Five"
mNos(86) = "Eighty Six"
mNos(87) = "Eighty Seven"
mNos(88) = "Eighty Eight"
mNos(89) = "Eighty Nine"
mNos(90) = "Ninety"
mNos(91) = "Ninety One"
mNos(92) = "Ninety Two"
mNos(93) = "Ninety Three"
mNos(94) = "Ninety Four"
mNos(95) = "Ninety Five"
mNos(96) = "Ninety Six"
mNos(97) = "Ninety Seven"
mNos(98) = "Ninety Eight"
mNos(99) = "Ninety Nine"
mStrAmt = numb.ToString("######0.00")
Dim mStrAmtlen As Integer = mStrAmt.Length
mAmt = Integer.Parse(mStrAmt.Substring(0, mStrAmtlen - 3))
mChrAmt = mStrAmt.Substring(mStrAmtlen - 2)
mLenAmt = mAmt.ToString().Length
If mAmt = 0 Then mLenAmt = 0
If Integer.Parse(mChrAmt.Substring(0, 1)) > 0 AndAlso mLenAmt = 0 Then
amtInWords = AmtCnvrt("", Integer.Parse(mChrAmt), "Paise Only.")
ElseIf mLenAmt = 0 Then
amtInWords = amtInWords & "Zero "
Else
If mLenAmt > 9 Then Return ""
If mLenAmt > 7 Then
amtInWords = amtInWords & AmtCnvrt("", Integer.Parse(mAmt.ToString().Substring(0, (mAmt.ToString().Length - 7))), "Crore ")
mAmt = Integer.Parse(mAmt.ToString().Substring(mAmt.ToString().Length - 7))
mLenAmt = mAmt.ToString().Length
End If
If mLenAmt > 5 Then
amtInWords = amtInWords & AmtCnvrt("", Integer.Parse(mAmt.ToString().Substring(0, (mAmt.ToString().Length - 5))), "Lakh ")
mAmt = Integer.Parse(mAmt.ToString().Substring(mAmt.ToString().Length - 5))
mLenAmt = mAmt.ToString().Length
End If
If mLenAmt > 3 Then
amtInWords = amtInWords & AmtCnvrt("", Integer.Parse(mAmt.ToString().Substring(0, (mAmt.ToString().Length - 3))), "Thousand ")
mAmt = Integer.Parse(mAmt.ToString().Substring(mAmt.ToString().Length - 3))
mLenAmt = mAmt.ToString().Length
End If
If mLenAmt = 3 Then
amtInWords = amtInWords & AmtCnvrt("", Integer.Parse(mAmt.ToString().Substring(0, (mAmt.ToString().Length - 2))), "Hundred ")
mAmt = Integer.Parse(mAmt.ToString().Substring(mAmt.ToString().Length - 2))
mLenAmt = mAmt.ToString().Length
End If
If mLenAmt < 3 AndAlso mAmt <> 0 Then
amtInWords = amtInWords & AmtCnvrt("", mAmt, "")
End If
If Integer.Parse(mChrAmt.Substring(0, 1)) > 0 Then
amtInWords = amtInWords & "Rupees And "
amtInWords = amtInWords & AmtCnvrt("", Integer.Parse(mChrAmt), "Paise Only.")
Else
amtInWords = amtInWords & "Only."
End If
End If
Return amtInWords
End Function
Public Function AmtCnvrt(ByVal Rs As String, ByVal pNo As Integer, ByVal pStr As String) As String
Return mNos(pNo) & " " & pStr
End Function
Call like below.
changeToWords("20,084")
Output
Twenty Thousand Eighty Four Only.