Quoting Derek Basch <dbasch at yahoo.com>: > Given a value (x) that is within the range (1e-1, 1e7) how do I round > (x) up to the closest exact logarithmic decade? For instance: How about this: def roundup(x): if x < 1: return 1 else: return '1' + ('0' * len(str(int(x)))) Jack Orenstein