BIN2OCT (Number, DigitCount?) BIN2OCT (Number; DigitCount?)
Number
Text Text
A binary number.
DigitCount
Number Number (optional)
The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used. It is ignored for negative numbers.
Returns
Text Text
An octal number.
Converts a binary number to an octal number. Negative numbers are written as ten digits in two's complement form. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using OCT2BIN.
Examples
BIN2OCT ("101")
BIN2OCT ("101")
Returns "5".
BIN2OCT ("101", 4)
BIN2OCT ("101"; 4)
Returns "0005".
BIN2OCT ("01111011")
BIN2OCT ("01111011")
Returns "173".
BIN2OCT ({ "101", "01111011" })
BIN2OCT ({ "101"; "01111011" })
Returns the array { "5", "173" }{ "5"; "173" }.
BIN2OCT ("1111111111")
BIN2OCT ("1111111111")
Returns "7777777777", -1 in two's complement form.