tuple_string — Convert a tuple into a tuple of strings.
tuple_string converts numbers to strings or modifies strings. The operator has two parameters: T is the number or string that has to be converted. Format specifies the conversion. This format string consists of the following four parts
<flags><field width><precision><conversion characters>
So a conversion might look like
tuple_string(1332.4554, '.6e', String)
Zero or more flags, in any order, which modify the meaning of the conversion specification. Flags may consist of the following characters:
The result of the conversion is left justified within the field.
The result of a signed conversion always begins with a sign, + or -.
If the first character of a signed conversion is not a sign, a space character is prefixed to the result. This means that if the space flag and + flag both appear, the space flag is ignored.
The value is to be converted to an “alternate form”. For d and s conversions, this flag has no effect. For o conversion (see below), it increases the precision to force the first digit of the result to be a zero. For x or X conversion (see below), a non- zero result has 0x or 0X prefixed to it. For e, E, f, g, and G conversions, the result always contains a radix character, even if no digits follow the radix character. For g and G conversions, trailing zeros are not removed from the result, contrary to usual behavior.
An optional string of decimal digits to specify a minimum field width. For an output field, if the converted value has fewer characters than the field width, it is padded on the left (or right, if the left-adjustment flag, - has been given) to the field width.
The precision specifies the minimum number of digits to appear for the d, o, x, or X conversions (the field is padded with leading zeros), the number of digits to appear after the radix character for the e and f conversions, the maximum number of significant digits for the g conversion, or the maximum number of characters to be printed from a string in s conversion. The precision takes the form of a period . followed by a decimal digit string. A null digit string is treated as a zero.
A conversion character indicates the type of conversion to be applied:
The integer argument is printed in signed decimal (d), unsigned octal (o), or unsigned hexadecimal notation (x and X). The x conversion uses the numbers and letters 0123456789abcdef, and the X conversion uses the numbers and letters 0123456789ABCDEF. The precision component of the argument specifies the minimum number of digits to appear. If the value being converted can be represented in fewer digits than the specified minimum, it is expanded with leading zeroes. The default precision is 1. The result of converting a zero value with a precision of 0 is no characters.
The floating-point number argument is printed in decimal notation in the style [-]dddrddd, where the number of digits after the radix character, r, is equal to the precision specification. If the precision is omitted from the argument, six digits are output; if the precision is explicitly 0, no radix appears.
The floating-point-number argument is printed in the style [-]drdddepmdd, where there is one digit before the radix character, and the number of digits after it is equal to the precision. When the precision is missing, six digits are produced; if the precision is 0, no radix character appears. The E conversion character produces a number with E introducing the exponent instead of e. The exponent always contains at least two digits. However, if the value to be printed requires an exponent greater than two digits, additional exponent digits are printed as necessary.
The floating-point-number argument is printed in style f or e (or in style E in the case of a G conversion character), with the precision specifying the number of significant digits. The style used depends on the value converted; style e is used only if the exponent resulting from the conversion is less than -4 or greater than or equal to the precision. Trailing zeros are removed from the result. A radix character appears only if it is followed by a digit.
The argument is taken to be a string, and characters from the string are printed until the end of the string or the number of characters indicated by the precision specification of the argument is reached. If the precision is omitted from the argument, it is interpreted as infinite and all characters up to the end of the string are printed.
Similar to the s conversion specifier, except that the string can contain backslash-escape sequences which are then converted to the characters they represent.
In no case does a nonexistent or insufficient field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is simply expanded to contain the conversion result.
Input tuple converted to strings.