Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%.f fails with unexpected placeholder #181

Open
daurnimator opened this issue Feb 13, 2019 · 1 comment · May be fixed by #188
Open

%.f fails with unexpected placeholder #181

daurnimator opened this issue Feb 13, 2019 · 1 comment · May be fixed by #188

Comments

@daurnimator
Copy link
Contributor

fengari-lua/fengari#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'
@ashwalk33r
Copy link

PR with fix #188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants