pyExcelerator big integer values

John Machin sjmachin at lexicon.net
Wed Jan 10 07:31:34 EST 2007


Gacha wrote:
> Thank you, the repr() function helped me a lot.
>
> v = unicode(values[(row_idx, col_idx)])
> if v.endswith('e+12'):
>     v = repr(values[(row_idx, col_idx)])

That endswith() looks rather suspicious ... what if it's +11 or +13,
and shouldn't it have a zero in it, like "+012" ??

Here's a possible replacement -- I say possible because you have been
rather coy about what you are actually trying to do.

value = values[(row_idx, col_idx)])
if isinstance(value, float):
    v = repr(value)
else:
    v = unicode(value)

HTH
John




More information about the Python-list mailing list