Skip to content

Allow BigInt usage in templates #11126

@YanDevDe

Description

@YanDevDe

What problem does this feature solve?

It would allow us to use numbers which is larger than MAX_SAFE_INTEGER.

What does the proposed API look like?

In HTML, {{BigInt("100")}}, {{100n}}, {{2n * 50n}} or {{50n + 50n}} should show "100" (it can be just simply string by using .toString()) at frontend.
At the moment using BigInt in "Mustache" syntax just throw error.
Sure, backup solution would be using external functions or converted into string and save it to variable. But using BigInt directly in HTML would be nice to have.
More Information about BigInt -> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

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