> def invoice(): > y = data.readline() > z = string.split(y, ',') > print "%s PN %s %s %0.2f" % (a, x, z[2], a*b) Ah, now z is a line split, How long is Z[2]? Does it have a lot of whitespace at the end? Try inserting a debugging statement: print len(z[2]) You may need to use strip to get rid of excess spaces etc... Alan G.