how to improve this simple block of code

Mel Wilson mwilson at the-wire.com
Wed Jan 11 16:08:09 EST 2006


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.




More information about the Python-list mailing list