Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigInt support breaks in 1.10.0 and later + "Support BigInt in the operators (Incomplete NumeralJs issue/feature request #778)" #752

Open
ryanwh-dw opened this issue Dec 13, 2023 · 0 comments

Comments

@ryanwh-dw
Copy link

So this issue could be "ported over" from numeral adamwdraper/Numeral-js#778 as it is still relevant and would be a welcome improvement.

I've also noticed that to get BigInt support it is possible to revert to older versions of numbro, but it is broken from 1.10.x and later, unless the expected implementation has changed.

The latest version I could find that is working is 1.9.3. See the code below with links for a very simple example.

import numbro from "numbro";
const value = BigInt(1000);

const testBigInt = numbro(value);

const elem = document.getElementById("app");

elem?.append(`${testBigInt.value()}`);

1.9.3 example - working
https://codesandbox.io/p/sandbox/working-bigint-w6wgvr

1.10.0 example - broken with Invalid input error
https://codesandbox.io/p/sandbox/broken-bigint-1-10-f6ny9f

2.4.0 example - broken with Cannot convert a BigInt value to a number error (still using legacy Old Format in example)
https://codesandbox.io/p/sandbox/broken-bigint-ttwsz4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant