User Tools

Site Tools

한국어

logicpython:cubloc_api:fp

This is an old revision of the document!


FP

Format a floating-point number with fixed whole and fractional digit counts.

Syntax

from cubloc import FP
 
FP(value: float, wholeNumberDigits: int, fractionalNumberDigits: int)

Parameters

  • value: Floating-point value to format.
  • wholeNumberDigits: Column width for the integer part.
  • fractionalNumberDigits: Number of digits after the decimal point.

Return Value

Returns a fixed-point string using the requested whole-number and fractional digit counts.

Exceptions

  • TypeError: An argument has an invalid type.

Example

from cubloc import FP
 
# Example usage
result = FP(1, 1, 1)
print(result)
logicpython/cubloc_api/fp.1775786798.txt.gz · Last modified: by 127.0.0.1