www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21814] New: std.fomat: grouping with width 0 causes floating

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

          Issue ID: 21814
           Summary: std.fomat: grouping with width 0 causes floating point
                    exception
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: bugzilla bernis-buecher.de

void main()
{
    writefln("%,0d",1000);
}

produces a floating point exception. It should handle this more gracefully,
e.g. do no grouping at all. In that case the following unittest would hold:

assert(format("%,0d",1000) == "1000");

--
Apr 09 2021