-
Notifications
You must be signed in to change notification settings - Fork 198
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
wrapper used with decimals
#73
Comments
Here's the error I'm encountering:
|
can you provide simple repro example? |
@sidorares I suspect this is actually already fixed in // Number with fractional part should be treated as number(double) including big integers in scientific notation, i.e 1.79e+308
return _options.storeAsString
? string
: /[\.eE]/.test(string)
? number
: _options.useNativeBigInt
? BigInt(string)
: new BigNumber(string); It just hasn't been released to NPM yet (see #74) and thus I'm seeing this bug in production. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the
useNativeBigInt
option is enabled, this package attempts to wrap decimals (e.g.0.990011990070343
) in the nativeBigInt
wrapper which fails (as they're obviously not integers). Instead,json-bigint
should be smart enough to realize that a long floating point number is not an integer and thus should not be wrapped at all.The text was updated successfully, but these errors were encountered: