DecToBin
Previous  Next

Converts a decimal number to a 32 bit binary number.
Syntax: DecToBin (Number As Int32) As String
Syntax: DecToBin2 (Number As UInt32) As String
Using the Format keyword you can remove the leading zeroes.

Example:
Sub App_Start
      bit.New1
      msgbox(bit.DecToBin(63)) '00000000000000000000000000111111
      msgbox(Format(bit.DecToBin(63),"d0")) '11111
End Sub