Mel Wilson wrote:
> py wrote:
>> Say I have...
>> x = "132.00"
>>
>> but I'd like to display it to be "132" ...dropping the trailing
>> zeros...
> 
> print '%g' % (float(x),)
> 
> might work.
> 
>       Mel.
> 
The input is a string, %g expects a float, TypeError exception.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to