On Tue, Jul 02, 2013 at 10:14:33PM -0700, Ali Çehreli wrote:
[...]
> import std.stdio;
> import std.conv;
> 
> void main()
> {
>     auto a = to!double("151.42499");
>     writefln("%.60f", a);
> }

I wouldn't write it like that; IMO it's better to write:

        writefln("%.*f", double.dig, a);

So that you don't give the wrong impression that there are more digits
than are actually there. Using double.dig also lets you see all the
digits that *are* there, not a rounded value, that the OP was
complaining about.


T

-- 
The easy way is the wrong way, and the hard way is the stupid way. Pick one.

Reply via email to