User Tools

Site Tools

한국어

logicpython:cubloc_api:decn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

logicpython:cubloc_api:decn [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:decn [2026/04/10 04:20] (current) – removed mfranklin
Line 1: Line 1:
-====== DecN ====== 
- 
-Decimal formatting variants: ''Dec'' and ''Dec1'' through ''Dec11''. 
- 
-===== Syntax ===== 
- 
-<code python> 
-from cubloc import DecN 
- 
-# Natural width 
-Dec(value: int) 
- 
-# Fixed width 
-Dec1(value: int) ... Dec11(value: int) 
-</code> 
- 
-===== Parameters ===== 
- 
-  * **value**: Integer ''value'' to format. 
-  * **digits**: Field width for ''DecN'' variants. Use 0 for natural width (''Dec''). 
- 
-===== Return Value ===== 
- 
-Returns the formatted decimal string using either natural width (Dec) or fixed-width right-justified text (Dec1 through Dec11). 
- 
-===== Notes ===== 
- 
-  * ''Dec(value)'' returns natural-width decimal text. 
-  * ''Dec1''..''Dec11'' return right-justified decimal text in fixed-width fields. 
- 
-===== 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))     # e.g. 42 
-print(Dec4(value))    # e.g. '  42' 
-print(Dec8(value))    # e.g. '      42' 
-</code> 
- 
-===== Related APIs ===== 
- 
-  * [[logicpython:cubloc_api:dp|DP]] 
-  * [[logicpython:cubloc_api:float|Float]] 
-  * [[logicpython:cubloc_api:fp|FP]] 
-  * [[logicpython:cubloc_api:hexn|HexN]] 
-  * [[logicpython:cubloc_api:hp|HP]] 
  
logicpython/cubloc_api/decn.1775786798.txt.gz · Last modified: by 127.0.0.1