cjlano / tinyprintf

A tiny printf and sprintf library for small embedded systems

Home Page:http://www.sparetimelabs.com/tinyprintf/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support commas?

simonhf opened this issue · comments

I tried changing the test file to:

#include <locale.h>
...
setlocale(LC_NUMERIC, "");
TPRINTF("%'llu\n", ULLONG_MAX);

But the output is:

$ make
...
libc_printf("%'llu\n", ULLONG_MAX) -> 18,446,744,073,709,551,615
 tfp_printf("%'llu\n", ULLONG_MAX) -> llu
...

The commas display for glibc as expected, but not for tfp. Any chance of adding comma support? Or at least understanding the ' character even if commas are not printed? If the locale stuff is too OTT for tinyprintf(), how about enabling comma support via an environment variable instead?