Skip to content

%.f fails with unexpected placeholder #181

@daurnimator

Description

@daurnimator

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions