Chris Angelico gmail.com> writes:
>
> On Wed, Mar 27, 2013 at 4:06 AM, Wolfgang Maier
> biologie.uni-freiburg.de> wrote:
> > Chris Angelico gmail.com> writes:
> >
> >>
> >> Try printing out this expression:
> >>
> >> "%.2f"%value if value else ''
> >>
> >> Without the rest of your code I can't
On Wed, Mar 27, 2013 at 4:21 AM, Ethan Furman wrote:
> On 03/26/2013 10:06 AM, Wolfgang Maier wrote:
>>
>> Chris Angelico gmail.com> writes:
>>
>>>
>>> Try printing out this expression:
>>>
>>> "%.2f"%value if value else ''
>>>
>>> Without the rest of your code I can't tell you how to plug that i
On 03/26/2013 10:06 AM, Wolfgang Maier wrote:
Chris Angelico gmail.com> writes:
Try printing out this expression:
"%.2f"%value if value else ''
Without the rest of your code I can't tell you how to plug that in,
but a ternary expression is a good fit here.
ChrisA
Unfortunately, that's n
Wolfgang Maier wrote:
> Chris Angelico gmail.com> writes:
>
>>
>> Try printing out this expression:
>>
>> "%.2f"%value if value else ''
>>
>> Without the rest of your code I can't tell you how to plug that in,
>> but a ternary expression is a good fit here.
>>
>> ChrisA
>>
>
> Unfortunately
On Wed, Mar 27, 2013 at 4:06 AM, Wolfgang Maier
wrote:
> Chris Angelico gmail.com> writes:
>
>>
>> Try printing out this expression:
>>
>> "%.2f"%value if value else ''
>>
>> Without the rest of your code I can't tell you how to plug that in,
>> but a ternary expression is a good fit here.
>>
>>
Chris Angelico gmail.com> writes:
>
> Try printing out this expression:
>
> "%.2f"%value if value else ''
>
> Without the rest of your code I can't tell you how to plug that in,
> but a ternary expression is a good fit here.
>
> ChrisA
>
Unfortunately, that's not working, but gives a TypeErr
In c...@isbd.net writes:
> What's a neat way to print columns of numbers with blanks where a number
> is zero or None?
print number or ' '
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
On Wed, Mar 27, 2013 at 2:50 AM, wrote:
> What's a neat way to print columns of numbers with blanks where a number
> is zero or None?
>
> E.g. I want to output something like:-
>
> Credit Debit Description
> 100.00 Initial balance
> 123.45 Payment for
What's a neat way to print columns of numbers with blanks where a number
is zero or None?
E.g. I want to output something like:-
Credit Debit Description
100.00 Initial balance
123.45 Payment for cabbages
202.00 Telephone bill
For ea