Skip to content

[BUG]: int64 long type data is not supported. When the data exceeds int64, there will be a loss of accuracy #462

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

Open
aninstein opened this issue Feb 24, 2025 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@aninstein
Copy link

Issue description

JS does not support long data type int64, but most server-side languages such as Java and Go support int64 data type, which can cause overflow in JS

Media & Screenshots

Image

Operating system

  • OS: [e.g. iOS]:
    macos
  • Browser [e.g. chrome, safari]:
    edge
  • Any other details...

Priority this issue should have

Low (slightly annoying)

@aninstein aninstein added the bug Something isn't working label Feb 24, 2025
@aninstein aninstein changed the title [BUG]: 19 bit long type data is not supported. When the data exceeds 19 bits, there will be a loss of accuracy [BUG]: int64 long type data is not supported. When the data exceeds int64, there will be a loss of accuracy Feb 24, 2025
@Prateek-Wayne
Copy link

I would like to pick this issue
Could you please assign this to me @AykutSarac .

@Prateek-Wayne
Copy link

Prateek-Wayne commented May 18, 2025

We're encountering precision loss for large int64 values (e.g., 123456789012345343443) during CSV ,YAML and JSON serialization. This happens because our current parser setup does not preserve large integers accurately.

CSV output (via fast-xml-parser) truncates or rounds the number:❌

transaction_id
123456789012345343443
Image

JSON output (via jsonc-parser) suffers from the same issue:❌

{
  "transaction_id": 123456789012345343443
}
Image

YAML:❌

transaction_id: 123456789012345343443
Image

XML:✅

<transaction>
  <transaction_id>123456789012345343443</transaction_id>
</transaction>
Image

@Prateek-Wayne
Copy link

Possible solution that came to my mind is to preprocess the json string to wrap large numbers which are greate than >16 digits in quotes before parsing.

@Prateek-Wayne
Copy link

@AykutSarac Please let me know if you're okay with this direction. If it looks good, I’ll go ahead and raise a PR with this solution.

@AykutSarac
Copy link
Owner

We should show it as a number on the diagram even if we parse them as string.

@Prateek-Wayne
Copy link

Prateek-Wayne commented May 19, 2025

We should show it as a number on the diagram even if we parse them as string.

@AykutSarac
I made it worked :)

Image

If you agree with the input and output from image,I will raise a pr
or let me know any change needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants