OCT2HEX
Converts an octal number to hexadecimal.
Syntax
expression.OCT2HEX(arg1, arg2);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | ApiRange | ApiName | number | The octal number to convert. | |
| arg2 | Optional | ApiRange | ApiName | number | The number of characters to use. |
Returns
number
Example
This example shows how to convert an octal number to hexadecimal.
- Code
- Result
// How to get a hexadecimal number form an octal.
// Use a function to convert an octal number to hexadecimal.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.OCT2HEX(7777777634, 4));