By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,799 Members | 1,403 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,799 IT Pros & Developers. It's quick & easy.

text coding help

P: 4
I used this type script for conversion of text to other language text and little modified
but this this used originally for numeric to word
how to modify for text conversion
Private Sub txtamount_Change()
Dim s, c, l, th, h, t, d As String
c = ""
l = ""
th = ""
h = ""
t = ""
d = ""
s = Str(Int(Val(txtamount.Text)))
d = (Str(Val(txtamount.Text) - Val(s)))
d = Str(Int(Val(d) * 100))
If Len(s) > 7 Then
If Len(s) = 9 Then
If Val(Left(s, 2)) = 0 Then
c = ""
Else
c = charcters(Val(Left(s, 2)))
c = c & " Crores "
End If
s = Right(s, 7)
ElseIf Len(s) = 8 Then
If Val(Left(s, 1)) = 0 Then
c = ""
Else
c = charcters(Val(Left(s, 1)))
c = c & " Crores "
End If
s = Right(s, 7)
End If
End If
If Len(s) > 5 Then
If Len(s) = 7 Then
If Val(Left(s, 2)) = 0 Then
l = ""
Else
l = charcters(Val(Left(s, 2)))
l = l & " Lakhs "
End If
s = Right(s, 5)
ElseIf Len(s) = 6 Then
If Val(Left(s, 1)) = 0 Then
l = ""
Else
l = charcters(Val(Left(s, 1)))
l = l & " Lakhs "
End If
s = Right(s, 5)
End If
End If
If Len(s) > 3 Then
If Len(s) = 5 Then
If Val(Left(s, 2)) = 0 Then
th = ""
Else
th = charcters(Val(Left(s, 2)))
th = th & " Thousand "
End If
s = Right(s, 3)
ElseIf Len(s) = 4 Then
If Val(Left(s, 1)) = 0 Then
th = ""
Else
th = charcters(Val(Left(s, 1)))
th = th & " Thousand "
End If
s = Right(s, 3)
End If
End If
If Len(s) > 2 Then
If Val(Left(s, 1)) = 0 Then
h = ""
Else
h = charcters(Val(Left(s, 1)))
h = h & " Hundred "
End If
s = Right(s, 2)
End If
If Len(s) > 0 Then
t = t & charcters(Val(s))
't = t & " Rs."
End If

If Val(d) = 0 Then
s = c & l & th & h & t & " Rs."
Else
d = charcters(Val(d))
s = c & l & th & h & t & " Rs. " & d & " Paise"
End If
txtinwords.Text = s
End Sub




Public Function charcters(Strchr As string) As String
If Strchr = a Then
charcters = ""
ElseIf Strchr = b Then
charcters = ""
ElseIf Strchr = c Then
charcters = ""
ElseIf Strchr = d Then
charcters = ""
ElseIf Strchr = e Then
charcters = "-"

End If
End Function
Mar 24 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
This question is being moved to the Visual Basic forum.

Technical questions are not allowed in the cafe.

ADMIN
Mar 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.