Bug 18599 – std.format %(...%) format does not allow modifiers that take additional arguments

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-03-12T16:31:07Z
Last change time
2024-12-01T16:33:01Z
Assigned to
No Owner
Creator
hsteoh
Moved to GitHub: phobos#10319 →

Comments

Comment #0 by hsteoh — 2018-03-12T16:31:07Z
Currently, this is supported: ----- import std.format; format("%(%.14f, %)", [ 1.1, 2.2, 3.3 ]); ----- and so is this: ----- format("%(%10.3f, %)", [ 1.1, 2.2, 3.3 ]); ----- However, this is not supported: ----- format("%(%.*f, %)", double.dig, [ 1.1, 2.2, 3.3 ]); ----- Nor this: ----- format("%(%*.3f, %)", 5, [ 1.1, 2.2, 3.3 ]); ----- Basically, any nested specifier that takes an additional argument is not supported, because of the way nested specifiers are implemented. It would be nice if this could somehow be made to work.
Comment #1 by bugzilla — 2021-03-27T19:23:32Z
*** Issue 20541 has been marked as a duplicate of this issue. ***
Comment #2 by robert.schadek — 2024-12-01T16:33:01Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10319 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB