The following works as expected but the format string will end hard-coded:

import std.stdio;
import std.format;

void main (

   ) {

   int intAmount = 1234567;

   writeln(format("%,d", intAmount)); /// eg: 1,234,567

}

I tried something like:

import std.stdio;
import std.format;
import core.stdc.locale;

void main (

   ) {

   setlocale(LC_ALL, "");

   int intAmount = 1234567;

writeln(format("%`d", intAmount)); /// please, note the backtick instead of ,

}

... to no avail :(

Reply via email to