


Now from the AsianCodeArray the 6th item is "52" which tells two things:Ī) the given number is in tenth position (of some order)ī) and the higher order is in Lakh's position because of the first letter of 52 is 5 and 4th item (5-1 = 4) in HigherDigitSouthAsianStringArray or HigherDigitHindiNumberArray is Lakh or लाख

These arrays that helps to find the place where the numbers falls inĪre quite important and interesting. Private Function FormatNumberPerLanguage( ByVal culterInfoName As String)ĭim ci As New (culterInfoName)Ĭi.NumberFormat.NumberDecimalDigits = 0 Return Me.Amount.ToString( " N", ci) I use the RegEx and call the RemoveSpacesfunction as: The process a space or two get attached in between the words so for the cleanup Separator = " " Next Return RemoveSpaces(result) Result = result & separator & HundredHindiDigitArray(digit) & " " & higherDigitHindiString I -= 1 ElseIf digit 0 Then ' Standard Number like 100, 1000, 1000000 and skip if digit is 0 Result = result & separator & HundredHindiDigitArray(wholeTenthPlaceDigit) & " " & _ Result = result & separator & HundredHindiDigitArray(digit)ĮlseIf codeIndex.Length = 2 And digit 0 Then ' Number in tenth place and skip if digit is 0 Dim suffixDigit As Integer = amountArray(j + 1)ĭim wholeTenthPlaceDigit As Integer = digit * 10 + suffixDigit HigherDigitHindiString = HigherDigitHindiNumberArray( CInt(codeIndex.Substring( 0, 1)) - 1) If Amount = 0 Then Return " शून्य" ' Unique and exceptional case If amountString.Length > 15 Then Return " That's too long." Dim amountArray() As Integer = NumberToArray(amountString)ĭim j As Integer = 0 Dim digit As Integer = 0 Dim result As String = " " Dim separator As String = " " Dim higherDigitHindiString As String = " " Dim codeIndex As String = " " For i As Integer = amountArray.Length To 1 Step -1 Private Function HindiStyle() As String Dim amountString As String = Amount.ToString These numbers, we take advantage of both backward ( i variable) and forward ( j variable) indices. If it’s in unit place, tenth place and other place. Once we know the place of the digit we can trisect the case as The logic behind this array is very simple, explained later in theĪrticle. We first find out in which place the given digits falls in like, unit, tenth, hundredth, and so on by using SouthAsianCodeArray.
