Closed ninnghazad closed 5 years ago
Good question, I think this is a bug!
The printf
specification doesn't prohibit this, though has the weird restriction that you can only ignore the tail of the argument list:
When numbered argument specifications are used, specifying the Nth argument requires that all the leading arguments, from the first to the (N-1)th, are specified in the format string.
However I think we can relax this requirement to just allow the arguments to be referenced any number of times in any order when using numbered arguments.
Consider:
where _() is i18n macro which returns translated singular/plural string depending on number_of_pigs. In the case of a single pig, i would want a sentence not containing the number 1. Now this won't work because
Tried using zero-width specifier like %1$00d or using %n to hide the 1. Is there a way to hide a parameter?