Skip to content

"{}".format(...) doesn't work #10768

@esotericpig

Description

@esotericpig

Your Godot version:

  • v4.4.stable.official [4c311cbee]
  • Linux

Issue description:

The format() example from this doc doesn't work for me.

var string = "I have {} cats.".format([3])
print(string)

It always produces this for me:

I have {} cats.

I also tried format(3) (no array) and also doesn't work.

The % way works, and {0} works.

Does Godot not support {}? If not, I would like it please. Thanks.

URL to the documentation page:

https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_format_string.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    archivedarea:manualIssues and PRs related to the Manual/Tutorials section of the documentationbugtopic:gdscript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions