FormatDoubleToString


Creates a string from a double number using a proper format.

Applications:Useful for preparing a number for display or communication with specific number of fractional digits, sign etc.

Syntax

C++
Python
 
def FormatDoubleToString(
	inDouble: float,
	/,
	*,
	inIntegerDigitCount: int = 0,
	inFractionalDigitCount: int = 3,
	inDecimalMark: str = "\".\"",
	inTrailingCharacter: str = "\"0\"",
	inForceSignPrinting: bool = False,
	inSuffix: str = "\"\""
)
-> outString: str

Parameters

Name Type Range Default Description
Input value inDouble float Input real
Input value inIntegerDigitCount int 0 - 1000 0 How many characters the integer part of the input real should have at least
Input value inFractionalDigitCount int 0 - 100 3 How many characters the fractional part of the input real should have
Input value inDecimalMark str "\".\"" The symbol used to separate the integer part from the fractional part of the number
Input value inTrailingCharacter str "\"0\"" Defines the trailing character
Input value inForceSignPrinting bool False Forces printing the sign of the number even if the number is positive
Input value inSuffix str "\"\"" Defines a suffix. Generally it is an unit of value (e.g. mm)
Output value outString str Output string