jicman:
> Where can I download your dlibs1 library?
This is D1 code, it's slow because I usually print only few numbers like this:
string thousands(TyIntegral)(TyIntegral n, string separator="_") {
static assert (IsType!(TyIntegral, byte, ubyte, short, ushort, int, uint,
long, ulong),
"thousands() accepts only a integral numeric argument.");
string ns = toString(abs(n)).reverse;
string[] parts;
for (int i = 0; i < ns.length; i += 3)
parts ~= ns[i .. (i+3) < length ? (i+3) : length];
return (n < 0 ? "-" : "") ~ parts.join(separator).reverse;
}
Bye,
bearophile