insert thousands separators

Nick Vargish nav at adams.patriot.net
Mon Jun 16 09:56:56 EDT 2003


Oops, not your fault Bengt, mine for not testing extensively
enough. I've used it enough that I should have caught the error. On
the other hand, it kind of indicates how often/thoroughly the report
it's being used for is actually read by the people who claimed to have
needed it. :^)

I've switched to one of the non-recursive versions, which looks more
reliable. Still doesn't work with floating point numbers, but I'm
dealing exclusively with integers right now, so it's not an issue for
me (yet).

Nick

ps. Looking at the library reference, it's not clear if there's an easy
way to extract the fractional portion of a float without hitting the
Standard Floating Point Problem:

>>> v = 2312.3123123
>>> v1 = int(v)
>>> v2 = v - v1
>>> v2
0.31231230000003052


-- 
#include<stdio.h> /* SigMask 0.3 (sig.c) 19990429 PUBLIC DOMAIN "Compile Me" */
int main(c,v)char *v;{return !c?putchar(*v-1)&&main(0,v+ /* Tweaks welcomed. */
1):main(0,"Ojdl!Wbshjti!=obwAqbusjpu/ofu?\v\1");}  /* build: cc -o sig sig.c */




More information about the Python-list mailing list