Python string formatting: the % operator, which the format filter of Jinja2 uses, and str.format().
Both support the conversions and the format specification that templates use: fill, alignment, sign, width, precision, and the types s, r, d, i, f, e, g, x, o, b, c and %.
Summary
Functions
Formats a non-negative float with decimals digits after the point, like Python "%.<decimals>f". A negative decimals rounds to tens, hundreds and so on.
Formats args and kwargs into format with the rules of Python str.format().
Formats args into format with the rules of the Python % operator.
Functions
Formats a non-negative float with decimals digits after the point, like Python "%.<decimals>f". A negative decimals rounds to tens, hundreds and so on.
The digits come from the exact value of the float, rounded half to even, as in Python.
@spec format(String.t(), list(), Otera.Dict.t()) :: String.t()
Formats args and kwargs into format with the rules of Python str.format().
Formats args into format with the rules of the Python % operator.