ник: osmor
Вопрос, почему не вот эту?
Public Function ToBinary(ByVal Number As Long) As String
ToBinary = Number Mod 2
Do While Number > 0
Number = Number \ 2
ToBinary = ToBinary & Abs(Number Mod 2 > 0)
Loop
ToBinary = StrReverse(ToBinary)
If Len(ToBinary) > 1 Then ToBinary = Mid(ToBinary, 2)
End Function
|
? LongToBinStr(5)
00000000000000000000000000000101
? ToBinary(5)
101