Comment #1 by andrej.mitrovich — 2012-01-12T12:12:49Z
Btw a workaround:
string str = to!string(pretty("123456"));
auto str1 = format("%s", str);
So to!string works as well, it's just format() that bails.
Comment #2 by andrej.mitrovich — 2012-01-12T12:23:57Z
Also that function is broken (I mean its result), fixed one is:
auto pretty(string src)
{
Appender!(dchar[]) res;
size_t i = 1;
while (!src.empty)
{
res.put(src.back);
src.popBack;
if (!src.empty && (i++ % 3 == 0))
res.put("_");
}
return retro(res.data);
}
I was hoping there was something like this in Phobos but it didn't catch my eye. Anywho..
Comment #3 by andrej.mitrovich — 2013-01-21T17:51:28Z