sprintf.js
sprintf.js copied to clipboard
%.f fails with unexpected placeholder
https://github.com/fengari-lua/fengari/issues/147
C language docs says the following about .precision field in sprintf() format:
If the period is specified without an explicit value for precision, 0 is assumed.
$ node
> require("sprintf-js").sprintf("%.f", 2)
Thrown:
SyntaxError: [sprintf] unexpected placeholder
> require("sprintf-js").sprintf("%.0f", 2)
'2'
PR with fix https://github.com/alexei/sprintf.js/pull/188