problem with std.variant rounding
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Apr 29 01:57:09 PDT 2017
On Friday, 28 April 2017 at 18:08:38 UTC, H. S. Teoh wrote:
> 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
Thanks, I missed the fact that * could be used for specifying the
precision, in addition to the width.
More information about the Digitalmars-d-learn
mailing list