Formualizer Docs
ReferenceFunctionsEngineering Functions

DEC2BIN

DEC2BIN: Converts a decimal integer to binary text.

Summary

Optionally pads the result with leading zeros using places.

Remarks

  • number is coerced to an integer and must be in [-512, 511].
  • Negative values are returned as 10-bit two's-complement binary strings.
  • places must be at least the output width and at most 10, or #NUM! is returned.

Examples

Convert a positive integer
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
101010
Pad binary output
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
00000101

FAQ

What limits apply to DEC2BIN?

number must be in [-512, 511], and optional places must be between output width and 10, else #NUM!.

Runtime metadata

Category

Engineering

Signature

DEC2BIN(arg1: Number, arg2…: Number)

Arity

min 1, max variadic

Arguments

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page