Is there an option in format specification to display zero values as blank, otherwise use format?
>>> from decimal import Decimal
>>> '{:+010,.2f}'.format(Decimal('1234.56'))
'+01,234.56'
>>> '{:???f}'.format(Decimal(0))
''
>>>
UPDATE:
I need the same behavior as here:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx#SectionSeparator
If Python doesn't have it in standard libraries, please confirm this and i will accept it as the answer.
No, you can't currently do it via a Python format specification. Use a conditional expression instead. For example:
print(format(a, '+010,.2f') if a else "")