OCT

OCT(number)

Returns the number converted to octal (Variant / String).


numberThe number you want to convert to octal (String or Double).

REMARKS
* The "number" can be any numeric or string expression.
* If "number" is not a whole number, then it is rounded to the nearest whole number before being evaluated.
* Each value may contain the numbers 0-9 and the letters A-F.
* You can represent octal numbers directly by using the "&" (ie &010 = 8).
* You can use the HEX function to return the number converted to hexadecimal.
* You can use the OCT$ function to return a String data type instead of a Variant data type.
* The equivalent Excel function is Application.WorksheetFunction.BIN2OCT
* The equivalent .NET function is Microsoft.VisualBasic.Conversion.Oct
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print Oct(3)   '= 3  
Debug.Print Oct(7) '= 7
Debug.Print Oct(63) '= 77
Debug.Print Oct(64) '= 100

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top