This shows you the differences between two versions of the page.
| logicpython:cubloc_api:hexn [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython:cubloc_api:hexn [2026/04/10 05:40] (current) – removed mfranklin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== HexN ====== | ||
| - | |||
| - | Hex formatting variants: '' | ||
| - | |||
| - | ===== Syntax ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import HexN | ||
| - | |||
| - | # Natural width | ||
| - | Hex(value: int) | ||
| - | |||
| - | # Fixed width | ||
| - | Hex1(value: int) ... Hex8(value: int) | ||
| - | </ | ||
| - | |||
| - | ===== Parameters ===== | ||
| - | |||
| - | * **value**: Integer '' | ||
| - | * **digits**: Field width for '' | ||
| - | |||
| - | ===== Return Value ===== | ||
| - | |||
| - | Returns the formatted uppercase hexadecimal string using either natural width (Hex) or fixed-width right-justified text (Hex1 through Hex8). | ||
| - | |||
| - | ===== Notes ===== | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import Hex, Hex2, Hex8 | ||
| - | |||
| - | # Use Hex for natural width, or HexN variants for fixed width. | ||
| - | value = 255 | ||
| - | print(Hex(value)) | ||
| - | print(Hex2(value)) | ||
| - | print(Hex8(value)) | ||
| - | </ | ||
| - | |||
| - | ===== Related APIs ===== | ||
| - | |||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||