www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17672] New: Example from std.format throws exceptions

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

          Issue ID: 17672
           Summary: Example from std.format throws exceptions
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: al.iv.korn gmail.com

Examples:

writeln(format("%,d", 1000)); // "1,000"
writeln(format("%,f", 1234567.891011)); // "1,234,567.891,011"
writeln(format("%,?d", '?', 1000)); // "1?000"
writeln(format("%,1d", 1000)); // "1,0,0,0"
writeln(format("%,*d", 4, -12345)); // "-1,2345"
writeln(format("%,*?d", 4, '_', -12345)); // "-1_2345"
writeln(format("%,6?d", '_', -12345678)); // "-12_345678"
assert(format("%12,3.3f", 1234.5678) == "   1,234.568", "'" ~
        format("%12,3.3f", 1234.5678) ~ "'");

from https://dlang.org/phobos/std_format.html throws exceptions.

E.g.:
std.format.FormatException /dlang/dmd/linux/bin64/../../src/phobos/std/format.d(1744):
integral

--
Jul 20 2017