Bug 8981 – bool and %s don't honor formating flags

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-08T07:34:00Z
Last change time
2015-06-09T05:15:01Z
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2012-11-08T07:34:10Z
```D import std.stdio; void main() { bool a = true; int b = 1; string c = "blaa"; "bool %%s: [%10s]".writefln(a); "bool %%d: [%10d]".writefln(a); "int %%s: [%10s]".writefln(b); "int %%d: [%10d]".writefln(b); "string %%s: [%10s]".writefln(c); } ``` Produces: ``` bool %s: [true] // <-- Here bool %d: [ 1] int %s: [ 1] int %d: [ 1] string %s: [ blaa] ``` Which is a shame, because I needed to write an array of bools, with "true"/"false", and alignment.
Comment #1 by andrej.mitrovich — 2013-02-03T12:34:39Z
Fixed in Issue 7142. *** This issue has been marked as a duplicate of issue 7142 ***