floating point value rounded to 6digits

greatsam4sure greatsam4sure at gmail.com
Tue Sep 19 22:44:06 UTC 2017


On Tuesday, 19 September 2017 at 21:52:57 UTC, Ivan Kazmenko 
wrote:
> On Tuesday, 19 September 2017 at 20:47:02 UTC, greatsam4sure 
> wrote:
>> double  value = 20.89766554373733;
>> writeln(value);
>> //Output =20.8977
>>
>> How do I output the whole value without using writfln,write or 
>> format. How do I change this default
>
> The default when printing floating-point numbers is to show six 
> most significant digits.
> You can specify the formatting manually with writefln, for 
> example,
>
>     writefln ("%.10f", value);
>
> will print the value with 10 digits after the decimal point.
> The writef/writefln function behaves much like printf in C.
>
> See here for a reference on format strings:
> https://dlang.org/library/std/format/formatted_write.html#format-string
>
> Ivan Kazmenko.

I don't  want to use write,writefln or format. I just want to 
change the default


More information about the Digitalmars-d-learn mailing list