I need to format a float to the format +-00.00, tried the basic string formatting but can't get the leading + or - sign or two leading 0s if the value is fractional, any pointers?
'%+06.2f' % 1.1123344
+ means always use sign 0 means zero fill to full width. 6 is the total field width including sign and decimal point .2 means 2 decimals. f is float
1.4m articles
1.4m replys
5 comments
57.0k users