how to convert base 8 number into decimal number ? help me pls ... thks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • c2h
    New Member
    • Nov 2006
    • 8

    how to convert base 8 number into decimal number ? help me pls ... thks

    pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by c2h
    pls help me to solve this problem : using VB to convert a base 8 number into decimal number ..... thks
    Hi this will do it for you;
    Code:
    Public Function ConvertOctalToDecimal(BinVal As String) As Long
    Dim lngVal As Long
    Dim lngTemp As Long
    Dim i As Integer
    Dim Length As Integer
    
    Length = Len(BinVal)
    For i = 0 To Length - 1
        lngTemp = CInt(Mid(BinVal, Length - i, 1))
        lngVal = lngVal + (lngTemp * (8 ^ i))
    Next i
    ConvertOctalToDecimal = lngVal
    End Function

    Comment

    • c2h
      New Member
      • Nov 2006
      • 8

      #3
      hello...willaka will, thankyou for your answer. It really work.... !! thanks u a lot !!!

      Comment

      Working...