"py" <[EMAIL PROTECTED]> writes: > Say I have... > x = "132.00" > but I'd like to display it to be "132" ...dropping the trailing > zeros...I currently try this
The two-strip solution is cleaner, but: > if x.endswith("0"): > x = x[:len(x)-1] x = x[:-1] or del x[-1] both improve that one statement. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list