954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help converting numbers to words

I am using VB.Net 2005 and I have been working on trying to get this project to convert the numbers entered on form1 in TxtBxAmount to words on formcheck in TxtBxAmount3 but I can not figure it out. I have searched the web high and low and can not find any one who can make this work right. Please help me.

Public Class Form1

Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click
TxtBxName.Text = ""
TxtBxAddress.Text = ""
TxtBxCityState.Text = ""
TxtBxPhone.Text = ""
TxtBxCheckNumber.Text = ""
TxtBxAccount.Text = ""
TxtBxPayableTo.Text = ""
TxtBxAmount.Text = ""
TxtBxMemo.Text = ""
End Sub
Private Sub BtnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEnter.Click
Dim CurrentDateAndTime As Date = Now
If TxtBxName.Text = "" Then
MessageBox.Show("Please Enter Your Full Name", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxAddress.Text = "" Then
MessageBox.Show("Please Enter Your Address", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxCityState.Text = "" Then
MessageBox.Show("Please Enter Your City,State and ZipCode", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxPhone.Text = "" Then
MessageBox.Show("Please Enter Your Phone Number", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxCheckNumber.Text = "" Then
MessageBox.Show("Please Enter A Check Number", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxAccount.Text = "" Then
MessageBox.Show("Please Enter Your Accont Number", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxPayableTo.Text = "" Then
MessageBox.Show("Please Enter The Name of The Person that the Check is to be Made Out To", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxAmount.Text = "" Then
MessageBox.Show("Please Enter The Amount to Write the Check for", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
If TxtBxMemo.Text = "" Then
MessageBox.Show("Please Enter the Reason You are Writing this Check", "Check Maker", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
Me.Hide()
My.Forms.Check.Show()
My.Forms.Check.LblName2.Text = TxtBxName.Text
My.Forms.Check.LblName.Text = TxtBxName.Text
My.Forms.Check.LblPayableTo2.Text = TxtBxPayableTo.Text
My.Forms.Check.LblAmount2.Text = TxtBxAmount.Text
My.Forms.Check.TxtBxAmount3.Text = CStr(TxtBxAmount.Text)
My.Forms.Check.LblAddress.Text = TxtBxAddress.Text
My.Forms.Check.LblCityState.Text = TxtBxCityState.Text
My.Forms.Check.LblPhone.Text = TxtBxPhone.Text
My.Forms.Check.LblAccount.Text = TxtBxAccount.Text
My.Forms.Check.LblCheckNumber2.Text = TxtBxCheckNumber.Text
My.Forms.Check.LblMemo2.Text = TxtBxMemo.Text
My.Forms.Check.LblDate.Text = CurrentDateAndTime.ToShortDateString
End Sub

Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClose.Click
Me.Close()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

End Class

WyattM
Newbie Poster
2 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

try for casting-i.e,
dim da as string
da=num.tostring()

i hope its correct.....

preetham.saroja
Junior Poster in Training
82 posts since Jun 2007
Reputation Points: 5
Solved Threads: 1
 

Nope, he probably wants something like:
http://vb-helper.com/howto_net_dollars_to_words2.html

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

Hi,

This is in VB6 , but u can easily Convert it to VB.net.

Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You