Closed ghost closed 5 years ago
Hello @cup, thank you for opening an issue. Unfortunately, i don't know what to do with your comment.
Do you wish to have grouping support in pprintpp
, too? If so, please understand that pprintpp
is only a frontend for whatever printf
implementation you use. That means, that if your printf
implementation has no grouping support, then pprintpp
will not be able to change that as it is not designed to do that.
Or do you have a printf
implementation that supports grouping, but it does not work well in combination with pprintpp
? If yes, and you wish for assistance fixing that, then i can help you best if you provide the exact format schema that pprintpp
would need to generate from given inputs.
@tfc for the purpose of this issue, lets assume that all printf
have grouping support. Now thats settled, how to do grouping with pprintpp
?
Hey @cup,
i just looked up how grouping in POSIX printf works:
#include <locale.h>
#include <stdio.h>
int main() {
setlocale(LC_ALL, ""); /* use user selected locale */
printf("%'d", 1000000);
}
with pprintpp it works out of the box:
#include <pprintpp.hpp>
#include <clocale>
#include <cstdio>
int main() {
setlocale(LC_ALL, ""); /* use user selected locale */
pprintf("{'}", 1000000);
}
In both cases, the output is 1,000,000
.
fmtlib offers grouping:
https://github.com/fmtlib/fmt