[Issue 17715] New: Floating point numbers are printed as integers

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 3 09:08:10 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17715

          Issue ID: 17715
           Summary: Floating point numbers are printed as integers
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: pgkos.bugzilla at yahoo.com

Currently, this example:

writeln(10000.01);

prints just "10000", probably because the call to snprintf inside
phobos/format.d formatValue implementation for floats uses "%g" by default.

It would be nice if the default formatter was e.g.:
%.8g for float type
%.16g for double type

--


More information about the Digitalmars-d-bugs mailing list