Nun der Titel dürfte reichen ;-)
Aus 63 wird 111111
Public Function DecToBin(ByVal Number As Double) As String
Dim Bin As New List(Of String)
Do
If Number Mod 2 = 0 Then
Bin.Add("0")
Else
Bin.Add("1")
End If
Number \= 2
Loop Until Number = 0
Bin.Reverse()
Return Join(Bin.ToArray, "")
End Function
1 Kommentare zum Snippet