is there a way to output formatted text following the locale settings ?
someone
someone at somewhere.com
Sat May 29 02:26:57 UTC 2021
On Wednesday, 26 May 2021 at 00:40:30 UTC, Paul Backus wrote:
> In that case, you will want to use the C library functions from
> [`core.stdc.stdio`][1].
```d
import core.stdc.stdio;
import core.stdc.locale;
import std.stdio;
void main (
) {
core.stdc.locale.setlocale(LC_ALL, "");
int intAmount = 1234567;
core.stdc.stdio.printf("%'d", intAmount); /// Deprecation:
format specifier `"%'"` is invalid ... but it works: 1,234,567 as
specified in my locale :)
}
```
But I can't use writeln() formatted with the ' character to get
on what's defined on my locale.
PS: Previously I stated the backtick, I was wrong, the format
specifier to get what's on the locale is the single quote, sorry
for that.
More information about the Digitalmars-d-learn
mailing list