Skip to content

Wrong behavior of string.format #147

Description

@Egor-Skriptunoff

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.

But Fengari raises error instead of assuming zero:

   > print(("%.0f"):format(42.5))
   43
   > print(("%.f"):format(42.5))
   SyntaxError: [sprintf] unexpected placeholder

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions