Skip to main content

floatformat

Display a float to a specified number of decimal places.

def floatformat(
text: any,
arg: int|str = -1
) - > string

Display a float to a specified number of decimal places.

Parameters

NameTypeDescription
textanyThe numeric value or string representation of a number to be formatted.
arg`intstr` = -1

Returns

TypeDescription
stringThe formatted numeric string, localized or unlocalized based on arguments, or an empty string if the input is invalid.