question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow BigInt usage in templates

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
posvacommented, Feb 19, 2020

BigInt could be added to the other allowed variables like Number in templates. It will only be supported by browsers supporting it though

2reactions
leslehcommented, Jun 25, 2020

BigInt has already good (still not large enough, Safari is still missing) cross browser support.

@YanDevDe Safari 14 beta now has BigInt support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Large Number data type - Microsoft Support
The Large Number data type stores a non-monetary, numeric value and is compatible with the SQL_BIGINT data type in ODBC. Use this data...
Read more >
C++ BigIntegers and the Curiously Recurring Template ...
I'm implementing a Big Integer library where the user can choose between fixed precision or arbitrary precision integers. Since great part of ...
Read more >
BIGINT Data Type | 6.3.x - Cloudera Documentation
BIGINT is a convenient type to use for column declarations because you can use any kind of integer values in INSERT statements and...
Read more >
Using Templates - OpenAPI Generator
The Java generator supports a library option. This option works by defining base templates, then applying library-specific template overrides. ...
Read more >
Documentation - TypeScript 3.2
BigInt. BigInts are part of an upcoming proposal in ECMAScript that allow us to model theoretically arbitrarily large integers. TypeScript 3.2 brings type- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found