Professional Documents
Culture Documents
Number To Text
Number To Text
End
End Sub
Private Sub Form_Load()
Text1 = 0
Text2 = ""
Text2.Appearance = 0
Text2.Enabled = False
Command1.Caption = "&Close"
End Sub
Private Sub Text1_Change()
Dim lenMax As Integer, i As Byte, Satang As String, Baht As String
lenMax = Len(Text1.Text)
For i = 1 To lenMax
If Mid(Text1.Text, i, 1) = "." Then
Satang = Right(Text1.Text, lenMax - i)
Baht = Left(Text1.Text, i - 1)
Exit For
Else
Baht = Left(Text1.Text, i)
End If
Next
If Baht <> "" Then Text2 = changenum(Baht) & ""
If Satang <> "" Then Text2 = Text2 & changenum(Satang) & _
IIf(changenum(Satang) <> "", "", "")
End Sub