• Increase font size
  • Default font size
  • Decrease font size

VB Programming: Convert Number to English Word

E-mail Print PDF

How to convert number into English word in VB6 or VBA Programming?

This sample is a conversion of the number into English word which coded in VB6 programming (also support VBA programming). It supports a large range of numbers start from 0 (zero), 10 (ten), 100 (hundred), 1000 (thousand) , 1000 000 (million), 1000 000 000 (billion), 1000 000 000 000 (trillion) until 1000 000 000 000 000 000 000 (sextillion).

You can include this code into your business software to convert number represent the amount (amount of invoice etc.) into English word.

The function to be called for the conversion named ConNumToEngLish with one parameter in String data type.

'    CONVERT NUMBER TO ENGLISH               '
'    BY : IECH SETHA                         '
'    E-Mail: 
 This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Private Const P_ENG_SEXTILLION As String = "sextillion"
Private Const P_ENG_QUINTILLION As String = "quintillion"
Private Const P_ENG_QUADRILLION As String = "quadrillion"
Private Const P_ENG_TRILLION As String = "trillion"
Private Const P_ENG_BILLION As String = "billion"
Private Const P_ENG_MILLION As String = "million"
Private Const P_ENG_THOUSAND As String = "thousand"
Private Const P_ENG_HUNDRED As String = "hundred"

Private Function P_ENG_CONVERT(ByVal pNum As String) As String
'On Error Resume Next
Dim MyOneNum, MyTwoNum
Dim strHun As String
Dim FixLen As Integer

MyTwoNum = Array("", "", "twenty", "thirty", _
                 "fourty", "fifty", _
                 "sixty", "seventy", _
                 "eighty", "ninety")
MyOneNum = Array("", "one", "two", "three", _
                "four", "five", "six", _
                "seven", "eight", "nine", _
                "ten", "eleven", "twelve", _
                "thirteen", "fourteen", "fifteen", _
                "sixteen", "seventeen", "eighteen", "nineteen")
    FixLen = GetFixLen(pNum)
    Select Case FixLen
        Case 2: strHun = P_ENG_HUNDRED
        Case 3: strHun = P_ENG_THOUSAND
        Case 6: strHun = P_ENG_MILLION
        Case 9: strHun = P_ENG_BILLION
        Case 12: strHun = P_ENG_TRILLION
        Case 15: strHun = P_ENG_QUADRILLION
        Case 18: strHun = P_ENG_QUINTILLION
        Case 21: strHun = P_ENG_SEXTILLION
        Case Else: strHun = ""
    End Select

To be continued.....please download source code below
Download Source Code Here


Download and Install Turbo C++ Software

E-mail Print PDF

I found that, some universities (for example in Cambodia) still include the subject of Computer Programming with Turbo C++ to the first year or second year class of faculty of Computer Science or Information Technology skill. I know some students and others who interest with Turbo C++ programming language need to find out this software to support their study and their works.
Please follow the below steps to get Turbo C++ software and install it into your computer!

This software is well running on Windows XP.

  1. Download Turbo C++ Software (Three files)
    File 1: Tc.exe Download
    File 2: Tc.r00 Download
    File 3: Tc.r01 Download
  2. Install Turbo C++ Software
    • Copy the three files you have downloaded into drive C:\ of your computer.
    • Double Click on Tc.exe in drive C:\
    • You will see folder named TC in drive C:\
  3. Download Font Khmer for Turbo C++ and Copy it into C:\TC\BGI and C:\TC\BIN
  4. Getting start the program
    Double click on TC.EXE in C:\TC\BIN
    Now ready to go…

This is the first screen of Turbo C++


Software: Direction System in Phnom Penh (DSPP)

E-mail Print PDF

Direction System in Phnom Penh (DSPP) is a computer software use to find public and private places on Phnom Penh map. This software was written in Microsoft Visual Basic 6.0 by students of Faculty of Computer Science of Royal University of Phnom Penh (RUPP), CAMBODIA in 2005. This software was proposed as a research and development topic in Science Fair 2005 at RUPP which sponsored by Heinrich Boll Foundation (Germany).

Download DSPP Software
Download Research Document (Khmer Language)


Page 19 of 19