Click here to Skip to main content
15,886,026 members
Articles / Programming Languages / Visual Basic

Convert numbers to words in English and Asian format

Rate me:
Please Sign up or sign in to vote.
4.97/5 (22 votes)
3 Jan 2012CPOL4 min read 91.3K   5.7K   33  
Convert number to readable words
Public Class Form1

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If TextBox1.Text = String.Empty Then
            Me.RichTextBox1.Text = String.Empty
            Me.RichTextBox2.Text = String.Empty
            Return
        End If

        Dim number As Long = CLng(Me.TextBox1.Text)


        Dim converter As New Converter(number, converter.ConvertStyle.English)
        Me.RichTextBox1.Text = converter.Convert


        converter = New Converter(number, NumberToWords.Converter.ConvertStyle.Asian)
        Me.RichTextBox2.Text = converter.Convert
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Nepal Nepal
I am not a programer but like to monkey around with the codes. I started with Excel VBA then jumped to VB.NET and spending my time at home with codes. CodeProject helped me a lot to learn and I am always thankful to all the individuals to make this happen.

Grow upwards and onwards!

Comments and Discussions