-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support for BigInt? #391
Comments
When this library was first created, BigInt wasn't widely supported across all browsers - but that has certainly changed. There's some considerations to be made because we'd either have to support BigInt internally, or truncate to the max integer, which negates some of the benefits from using BigInt. I would certainly thing supporting this in the future could be a possibility though. |
I figured as much, and it's not even that there is necessarily a need to work with numbers that big, just that it's becoming more common for source data to be returned in that (bigInt) format - Square (my case in question) is very widely used, for example. In the short term, since bigInt's stringify to a usable integer (within the bounds of discussions), I am able to resolve my issues by making my current calls with a .toString() on the end of the values. That might be sufficient as a short term (non-breaking) fix for the interim. |
Hey folks, curious to understand what (if any) plans you have for supporting the bigint type?
I'm migrating some code to use the latest Square SDK and noticed that they are now returning all numbers as bigint, and creating a currency from a bigint results in a $0.00 value.
currency(100).format() --> $1.00
currency(100n).format() --> $0.00
The text was updated successfully, but these errors were encountered: