is there a way to output formatted text following the locale settings ?

Paul Backus snarwin at gmail.com
Sat May 29 02:59:43 UTC 2021


On Saturday, 29 May 2021 at 02:26:57 UTC, someone wrote:
> ```d
>    core.stdc.stdio.printf("%'d", intAmount); /// Deprecation: 
> format specifier `"%'"` is invalid ... but it works: 1,234,567 
> as specified in my locale :)
> ```

D warns for format specifiers that do not conform to the C99 
standard, and the `'` flag character is not part of C99. GCC 
gives a similar warning with `-Wall -pedantic`:

```
$ gcc -Wall -pedantic -o example example.c
example.c: In function ‘main’:
example.c:5:9: warning: ISO C does not support the ''' printf 
flag [-Wformat=]
   printf("%'d\n", 123456789);
          ^~~~~~~
```


More information about the Digitalmars-d-learn mailing list