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

[feature request] BigInt support #231

Open
dhbaird opened this issue Jan 16, 2024 · 0 comments
Open

[feature request] BigInt support #231

dhbaird opened this issue Jan 16, 2024 · 0 comments

Comments

@dhbaird
Copy link

dhbaird commented Jan 16, 2024

// Expect this:
console.log(sprintf("%d", 9999999999999999999999999999999999999999n));
// To print this:
// 9999999999999999999999999999999999999999

// But instead, an error such as the following is generated:
sprintf-js/src/sprintf.js:61
                if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
                                                                                ^

TypeError: Cannot convert a BigInt value to a number

Thanks!

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