User Tools

Site Tools

한국어

logicpython:cubloc_api:dp

Differences

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

Link to this comparison view

logicpython:cubloc_api:dp [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:dp [2026/04/10 04:21] (current) – removed mfranklin
Line 1: Line 1:
-====== DP ====== 
- 
-Convert an integer to a right-justified decimal string. 
- 
-===== Syntax ===== 
- 
-<code python> 
-from cubloc import DP 
- 
-DP(value: int, numberOfDigits: int, zeroPrint: int) 
-</code> 
- 
-===== Parameters ===== 
- 
-  * **value**: Integer to format. 
-  * **numberOfDigits**: Total column width. The result is right-justified and padded on the left with spaces (''zeroPrint=0'') or zeros (''zeroPrint=1''). 
-  * **zeroPrint**: 0 to pad with spaces, 1 to pad with zeros. 
- 
-===== Return Value ===== 
- 
-Returns a right-justified decimal string padded with spaces or zeros according to ''zeroPrint''. 
- 
-===== Exceptions ===== 
- 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: An argument is not an integer. 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''zeroPrint'' is not 0 or 1. 
- 
-===== Example ===== 
- 
-<code python> 
-from cubloc import DP 
- 
-# Example usage 
-result = DP(1, 1, 1) 
-print(result) 
-</code> 
- 
-===== Related APIs ===== 
- 
-  * [[logicpython:cubloc_api:decn|DecN]] 
-  * [[logicpython:cubloc_api:float|Float]] 
-  * [[logicpython:cubloc_api:fp|FP]] 
-  * [[logicpython:cubloc_api:hexn|HexN]] 
-  * [[logicpython:cubloc_api:hp|HP]] 
  
logicpython/cubloc_api/dp.1775786798.txt.gz · Last modified: by 127.0.0.1