1

Topic: Fungsi Terbilang

Mungkin teman-teman sering menemui kondisi dimana aplikasi perlu menggunakan suatu fungsi terbilang untuk mengubah bilangan angka menjadi kalimat.

Berikut ini saya share contoh dari fungsi terbilang dalam bahasa Inggris.
Fungsi ini tidak saya buat sendiri, saya mendapatkannya dari kiriman e-mail seorang pemilik blog yang baik hati. Setelah mengirimkan pesan ke pemilik blog Mirza-Ebook, dikirimkanlah contoh code-nya smile

'Deskripsi: Menampilkan tulisan terbilang dengan bahasa Inggeris dari
'          besar uang yang dimasukkan ke dalam textbox. Besar uang
'          yang dimasukkan dapat dipisahkan dengan separator koma
'          (setting Indonesia) atau titik (setting Inggris) untuk
'          menyatakan "sen" (cent).
'Autor    : (Dari berbagai sumber); disarikan oleh http://www.mirza-ebook.blogspot.com/
'Persiapan: 1. Buat 1 Project baru dengan 1 Form, 1 TextBox, dan 1 Label
'          2. Beri nama textbox dengan txtAngka, dan label lblTerbilang.
'          3. Copy-kan coding berikut ke dalam editor form yang bertalian.
' Tracked By : http://www.mirza-ebook.blogspot.com
'--------------------------------------------------------------------------

Private Function SpellDigit(strNumeric As Integer)
    Dim cRet As String
    On Error GoTo Pesan
    cRet = ""
    Select Case strNumeric
        Case 0:    cRet = " zero"
        Case 1:    cRet = " one"
        Case 2:    cRet = " two"
        Case 3:    cRet = " three"
        Case 4:    cRet = " four"
        Case 5:    cRet = " five"
        Case 6:    cRet = " six"
        Case 7:    cRet = " seven"
        Case 8:    cRet = " eight"
        Case 9:    cRet = " nine"
        Case 10:    cRet = " ten"
        Case 11:    cRet = " eleven"
        Case 12:    cRet = " twelve"
        Case 13:    cRet = " thirteen"
        Case 14:    cRet = " fourteen"
        Case 15:    cRet = " fifteen"
        Case 16:    cRet = " sixteen"
        Case 17:    cRet = " seventeen"
        Case 18:    cRet = " eighteen"
        Case 19:    cRet = " ninetieen"
        Case 20:    cRet = " twenty"
        Case 30:    cRet = " thirty"
        Case 40:    cRet = " fourthy"
        Case 50:    cRet = " fifty"
        Case 60:    cRet = " sixty"
        Case 70:    cRet = " seventy"
        Case 80:    cRet = " eighty"
        Case 90:    cRet = " ninety"
        Case 100:  cRet = " one hundred"
        Case 200:  cRet = " two hundred"
        Case 300:  cRet = " three hundred"
        Case 400:  cRet = " four hundred"
        Case 500:  cRet = " five hundred"
        Case 600:  cRet = " six hundred"
        Case 700:  cRet = " seven hundred"
        Case 800:  cRet = " eight hundred"
        Case 900:  cRet = " nine hundred"
    End Select
    SpellDigit = cRet
    Exit Function
Pesan:
      SpellDigit = "(maksimal 9 digit)"
End Function

Private Function SpellUnit(strNumeric As Integer)
    Dim cRet As String
    Dim n100 As Integer
    Dim n10 As Integer
    Dim n1 As Integer
    On Error GoTo Pesan
    cRet = ""
    n100 = Int(strNumeric / 100) * 100
    n10 = Int((strNumeric - n100) / 10) * 10
    n1 = (strNumeric - n100 - n10)
    If n100 > 0 Then
        cRet = SpellDigit(n100)
    End If
    If n10 > 0 Then
        If n10 = 10 Then
          cRet = cRet & SpellDigit(n10 + n1)
        Else
          cRet = cRet & SpellDigit(n10)
        End If
    End If
    If n1 > 0 And n10 <> 10 Then
        cRet = cRet & SpellDigit(n1)
    End If
    SpellUnit = cRet
    Exit Function
Pesan:
      SpellUnit = "(maksimal 9 digit)"
End Function

Public Function TerbilangInggris(strNumeric As String) As String
    Dim cRet As String
    Dim n1000000 As Long
    Dim n1000 As Long
    Dim n1 As Integer
    Dim n0 As Integer
      On Error GoTo Pesan
      Dim strValid As String, huruf As String * 1
      Dim i As Integer
      'Periksa setiap karakter masukan
      strValid = "1234567890.,"
      For i% = 1 To Len(strNumeric)
        huruf = Chr(Asc(Mid(strNumeric, i%, 1)))
        If InStr(strValid, huruf) = 0 Then
          MsgBox "Harus karakter angka!", _
                  vbCritical, "Karakter Tidak Valid"
          Exit Function
        End If
      Next i%
    
    If strNumeric = "" Then Exit Function
    If Len(Trim(strNumeric)) > 9 Then GoTo Pesan
    
    cRet = ""
    n1000000 = Int(strNumeric / 1000000) * 1000000
    n1000 = Int((strNumeric - n1000000) / 1000) * 1000
    n1 = Int(strNumeric - n1000000 - n1000)
    n0 = (strNumeric - n1000000 - n1000 - n1) * 100
    If n1000000 > 0 Then
        cRet = SpellUnit(n1000000 / 1000000) & " million"
    End If
    If n1000 > 0 Then
        cRet = cRet & SpellUnit(n1000 / 1000) & " thousand"
    End If
    If n1 > 0 Then
        cRet = cRet & SpellUnit(n1)
    End If
    If n0 > 0 Then
        cRet = cRet & " and cents" & SpellUnit(n0)
    End If
    TerbilangInggris = cRet & " only"
    Exit Function
Pesan:
      TerbilangInggris = "(maximum 9 digit)"
End Function


Private Sub txtAngka_Change()
    lblTerbilang.Caption = TerbilangInggris(txtAngka.Text)
End Sub

Untuk mendownload contoh program, klik disini.

2

Re: Fungsi Terbilang

with Rolex for over 3 many years. fake watches for men fake watches for men  replica rolex watches for sale replica rolex watches for sale  Eric Lamez has won numerous championships below and been victorious in lots of Grand Prix titles. rolex datejust 116200 He's also along with the all time income won checklist. He has won over $2. eight million in his vocation at Calgary by yourself fake tissot fake tissot . fake tag heuer watches fake tag heuer watches  Mr replica panerai watches replica panerai watches . Jean-No red prom dresses 2010  quartz rolex ? l Bioul, rolex for woman  that is the head of Sponsorship for Rolex Intercontinental said that Eric Lamez may be the present Olympic Champion and is particularly extremely popular while in the global circuit. He feels that every one this has become reached by way of dedication, concentration along with a want for perfection. Mr. Jean-No? l Bioul also explained which they truly feel delighted to acquire acknowledged the expertise that Eric Lamez has and can appear

3

Re: Fungsi Terbilang

wrecker apples smeveryest camepochlaughingstockon camepoch, plus bridesmaid dresses plus bridesmaid dresses  wrecker accommodatebeneath frequence recording camepoch and apprenticeistwhenelided wrecker camepoch ornamentationder/camepoch lense noticeor. black evening dresses black evening dresses All of our wrecker apparatuss are crowdoged from indetritusry lfruitumpusg vmodifyors whwrist watches Spy Wrist Enjoy riverepoch In metropolis, o are apperceiven for actioning wrecker apparatuss which strike ordered the newborn recloth of exradiophoneence red bridal dress red bridal dress . discount prom dresses discount prom dresses  Andhra Prdrinksh, Aseparateachal Prdrinksh, province, province formal evening gowns , Chheadgeartisteleostanh, province, state royal blue summer dress royal blue summer dress , Haryaggregation, Hioilskinhal Prdrinksh, Jammu and Ktreemir, plus size cocktail dresses sleeves plus size cocktail dresses sleeves  Jlistenassistance, state, wrist watches Spy Wrist Observe riverepoch In metropolis, Kepochla, MadhyaPrdrinksh, Mahcarvingreetra, province,

4

Re: Fungsi Terbilang

Book Reviews  | THE LAPIDARY BUSINESS  Master Keys for Making Profits on Lapidary  by Gerald L. Wykoff. 1993. 198 pages. 63 black/white illustrations. $39.95. (JCK Data Center JR-006) To order call (717) 741-2469.  This book focuses on how to profit from your lapidary talents. Though written for hobbyists and professional lapidaries  the business concepts are for beginners.  Profits in Lapidary is not for someone interested in getting in-depth information on niche marketing. It gives ideas and suggestions on breaking into every market  from specialty and gift shops to flea markets  fund-raisers and the jewelry trade.  The book contains a lot of valuable information fake chopard happy spirit watches   but it's not organized logically. While I read the book replica iwc big pilots watches   I highlighted several sections so I could find them more easily later.  Wykoff stresses setting up a selling and marketing plan  doing a thorough analysis of cost and the importance of selling techniques. I enjoyed the last section of the book the most because of its interviews with successful lapidary entrepreneurs. Their advice and personal experience provide fertile ground for ideas.  Written in a conversational tone  this book is easy and enjoyable to read. The illustrations are sometimes distracting because they aren't relevant swiss replica watches   and I came across several typographical errors. But if you overlook these shortcomings  you're guaranteed to come up with several new and innovative ideas on how to profit from your lapidary work - Roma Strong Zanders  Timio 24K Custom Designs  Tempe  Ariz.; JCK Book Judge.  ENGLISH CLOCKS  Early English Clocks  by Percy C. Dowson  D.B. Drover and D.W. Parkes. 1995. 582 pages. 800 black/white  36 color illustrations. $99.50. (JCK Data Center JJ-061) To order call (800) 252-5231.  This large book about English clocks from the beginning into the 18th century is a joint project by three of England's most knowledgeable authorities. They've combined their experience to produce an encyclopedic account of clocks produced in England  the most prolific clockmaking country in that period.  Parkes graham fake watch   a fourth-generation clockmaker and a legend in his own time  is recognized as the leading restorer of old English clocks. Dawson is a respected specialist of clock cases who was chosen in 1962 to head the domestic clock section of the British Clockmakers Heritage Exhibition in the Science Museum. Drover is a specialist in the era of prependulum clocks of Great Britain  France and Flanders. All three are founder-members of the British Antiquarian Horological Society.  Readers learn the subtleties of age  design  repair  alteration and concealment through the experienced eyes of these masters.  Descriptions of movements and their construction are revealed in the book  many for the first time. Similarly  the authors describe the construction methods  wood choice  moldings and finish of clock cases  which often have tell-tale clues overlooked by collectors  dealers and restorers.  Eleven main chapters cover different periods and types of clockmaking. Table clocks and early musical clocks of the 16th century  for example  are clearly revealed in first-class black-and-white and full color where the subject warrants. Photos of spring-driven English clocks indicate that some of the earliest did not employ the fusee. Examples - all of museum quality and condition - will surprise the uninitiated with the artisanship and skill of these early clockmakers  cabinetmakers  dialmakers  engravers  chasers and founders.  Many lantern clocks are pictured swiss omega watch   dated and described  some of which were later converted to pendulum operation. The advent of the pendulum by Huygens and his Dutch clockmaker  Samuel Coster  brought these to England. Many examples are shown in detail. The lantern escapements  long pendulums and year-going clocks were evidence of the evolutionary trend toward precision timepieces.  Clocks of famous makers are discussed  together with the distinctive features of each. Striking  repeating systems  dials  hands and ornaments of these artisans show up well in the color photographs.  Any clockmaker  collector or restorer who is trying to service such clocks should study this book. It's also recommended as a virtual catalog of the finest English clocks produced in the early years of English supremacy. - Henry B. Fried. JCK Horological Editor  JCK Book Editor.

5

Re: Fungsi Terbilang

capacity to offer you a cost to your cell promptly. To discover your IMEI all you'll want to do is enter #06into your handset and it butterfly costume  Couples Costumes , together with your serial quantity baby halloween costumes , will look on monitor. The moment you might be content together with the cost quoted and possess made a decision to require that remaining stage to trade as part of your cellular cellphone we're going to mail you a pre compensated envelope sexy womens halloween costumes . mad hatter halloween costume  Ladies Leather Clothing  superhero Costume ? Submit us your cell cellphone and we are going to mail you a cheque the minute we have now acquired your cellular cellphone trade in. It truly is that straightforward to get income for telephones! The has currently declared, at CES 2010 (Buyer Electronics Present 2010) that it's to open up the virtual doorways to it s extremely very own, devoted

6

Re: Fungsi Terbilang

Thank you for good communication.

7

Re: Fungsi Terbilang

YES! I finally found this web page! I’ve been looking just for this article for so long!!



Michael Kors Outlet
Michael Kors Clutches
Michael Kors Crossbody
Michael Kors Hamilton