[Tutor] Some questions about my yen-USD.py

Alan Gauld alan.gauld at freenet.co.uk
Fri Sep 8 21:40:53 CEST 2006


> Alan Gauld wrote:
>> unfortunately 3 values won't work, it only works for numbers...
>> 
>>>>> "%**.*" % ('-', 12,3,123.456789)
>> 
>> Error...
> 
> How about this:
> In [4]: "%*.*f" % (-12,3,123.456789)
> Out[4]: '123.457     '

Silly me! Obvious when you see it :-)

Alan G.


More information about the Tutor mailing list