[Issue 3479] New: writef/writefln: positional precision not working

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 6 07:56:51 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3479

           Summary: writef/writefln: positional precision not working
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: ASSIGNED
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: andrei at metalanguage.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-11-06 07:56:50 PST ---
(credit due to Leandro Lucarella)

import std.stdio;

void main() {
    int hour = 1, min = 2, precision = 2, sec = 3;
    writef("%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec);
}

and it prints

1:002:003

But it should really print:

1:02:03

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list