⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 VB二进制十 六进制之间转换的小程序
💻 BAS
字号:
Attribute VB_Name = "Module1"
Option Explicit

Public Function DecimalToBinary(DecimalValue As Long, MinimumDigits As Integer) As String

Dim result As String
Dim ExtraDigitsNeeded As Integer

DecimalValue = Abs(DecimalValue)

Do
    result = CStr(DecimalValue Mod 2) & result
    DecimalValue = DecimalValue \ 2
Loop While DecimalValue > 0


ExtraDigitsNeeded = MinimumDigits - Len(result)
If ExtraDigitsNeeded > 0 Then
    result = String(ExtraDigitsNeeded, "0") & result
End If

DecimalToBinary = result

End Function



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -