the general format of specifier is [[fill[align]][sign][ ][widthprecision][typewhere each part enclosed in [is optional the width specifier specifies the minimum field width to useand the align specifier is one of ''or '^for leftrightand centered alignment within the field an optional fill character fill is used to pad the space for examplename "elwoodr "{ :< }format(namer "{ :> }format(namer "{ :^ }format(namer "{ :=^ }format(namer 'elwood elwoodr elwood '==elwood==the type specifier indicates the type of data table lists the supported format codes if not suppliedthe default format code is 'sfor strings'dfor integersand 'ffor floats table advanced string formatting type specifier codes character output format , , decimal integer or long integer binary integer or long integer octal integer or long integer hexadecimal integer or long integer hexadecimal integer (uppercase lettersfloating point as [-] dddddd floating point as [-] dddddde+-xx floating point as [-] dddddde+-xx use or for exponents less than - or greater than the precisionotherwiseuse same as except that the current locale setting determines the decimal point character multiplies number by and displays it using format followed by sign string or any object the formatting code uses str(to generate strings single character the sign part of format specifier is one of '+''-'or '+indicates that leading sign should be used on all numbers '-is the default and only adds sign character for negative numbers adds leading space to positive numbers the precision part of the specifier supplies the number of digits of accuracy to use for decimals if leading ' is added to the field width for numbersnumeric values are padded with leading to fill the space here are some examples of formatting different kinds of numbersx '{ : }format(xr '{ : }format(xr '{ : }format(xr '{ : }format(xr ar ' '{ : }format(yr lib fl ff