std.format add dash separators to large numbers
Jouko Koski
joukokoskispam101 at netti.fi
Tue Aug 16 22:13:31 PDT 2011
"bearophile" <bearophileHUGS at lycos.com> wrote:
> Andrej Mitrovic:
>> auto str = format("%s", 1000000);
>> assert(str == "1_000_000");
> I suggest to add such formatter/function to Phobos.
While 1_000_000 may be the right thing in program code, the outside world
would probably like to have numbers printed out according to their locale
conventions. This is even more important with floating point or monetary
values.
So before just adding some formatter to Phobos, I think that such
formatter's use cases should be considered quite carefully.
--
Jouko
More information about the Digitalmars-d-learn
mailing list