Garry's Mod Wiki

math.IntToBin

  string math.IntToBin( number int )

Description

Converts an integer to a binary (base-2) string.

Arguments

1 number int
Number to be converted.

Returns

1 string
Binary number string. The length of this will always be a multiple of 3.

Example

Prints the binary representation of 4

Output: 100