Sign in Join
FPDoc Onlineexperiment

IntToBin function

In unit StrUtils

Converts an integer to a binary string representation, inserting spaces at fixed locations.

Declaration

pascal
function IntToBin(Value: LongInt; Digits: Integer; Spaces: Integer)
: string

Arguments

Value

Value to convert.

Digits

Number of bits in the resulting string.

Spaces

Number of digits after which to insert a space.

Function result

Resulting string.

Description

IntToBin converts Value to a string with it's binary (base 2) representation. The resulting string contains Digits digits, with spaces inserted every Spaces digits. Spaces equal to zero yields a result without spacing. If Digits is larger than 32, it is truncated to 32.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.