This shows you the differences between two versions of the page.
| logicpython:cubloc_api:decn [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython:cubloc_api:decn [2026/04/10 04:20] (current) – removed mfranklin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== DecN ====== | ||
| - | |||
| - | Decimal formatting variants: '' | ||
| - | |||
| - | ===== Syntax ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import DecN | ||
| - | |||
| - | # Natural width | ||
| - | Dec(value: int) | ||
| - | |||
| - | # Fixed width | ||
| - | Dec1(value: int) ... Dec11(value: | ||
| - | </ | ||
| - | |||
| - | ===== Parameters ===== | ||
| - | |||
| - | * **value**: Integer '' | ||
| - | * **digits**: Field width for '' | ||
| - | |||
| - | ===== Return Value ===== | ||
| - | |||
| - | Returns the formatted decimal string using either natural width (Dec) or fixed-width right-justified text (Dec1 through Dec11). | ||
| - | |||
| - | ===== Notes ===== | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ===== Example ===== | ||
| - | |||
| - | <code python> | ||
| - | from cubloc import Dec, Dec4, Dec8 | ||
| - | |||
| - | # Use Dec for natural width, or DecN variants for fixed width. | ||
| - | value = 42 | ||
| - | print(Dec(value)) | ||
| - | print(Dec4(value)) | ||
| - | print(Dec8(value)) | ||
| - | </ | ||
| - | |||
| - | ===== Related APIs ===== | ||
| - | |||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||
| - | * [[logicpython: | ||