problem with std.variant rounding

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 28 11:08:38 PDT 2017


On Fri, Apr 28, 2017 at 04:42:28PM +0000, via Digitalmars-d-learn wrote:
[...]
>         writefln(text("%.", i, "f"), x);
[...]

There's no need to use text() here:

	writefln("%.*f", i, x);

does what you want.


T

-- 
"You know, maybe we don't *need* enemies." "Yeah, best friends are about all I can take." -- Calvin & Hobbes


More information about the Digitalmars-d-learn mailing list