Skip to content

Conversation

@johannes-vogel
Copy link
Contributor

@johannes-vogel johannes-vogel commented Jul 21, 2025

We are experimenting with the new data format versions (see #278) that the new version has included and stumbled over a bug that caused a precision loss. This PR includes the minimum fix for our tests to succeed.

The following value provided for a LONGDATE 2025-07-21T09:15:33.873Z results in a precision loss.

I also there's more improvement potential but that's for you to decide.

@IanMcCurdy FYI

minutes = ~~ts[5];
seconds = ~~ts[6];
nanoseconds = ~~((ts[6] * 1000000000) % 1000000000);
nanoseconds = ~~((ts[6] * 10000000) % 10000000);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, one could split ts[6] by the dot and convert the parts to a number or even adapt the timestamp regexp.

@IanMcCurdy
Copy link
Collaborator

Hi Johannes, thanks for looking into this issue. I apologize for the delay in getting back to you, but the fix you've come up with looks valid to me - I'll put it through our internal review process and we'll get it submitted as soon as possible.

@johannes-vogel
Copy link
Contributor Author

Hi Johannes, thanks for looking into this issue. I apologize for the delay in getting back to you, but the fix you've come up with looks valid to me - I'll put it through our internal review process and we'll get it submitted as soon as possible.

Please be aware, that this is sufficient for our usage since we have ms precision but values like '33.33333' are still prone to precision loss:

~~(('33.33333' * 10000000) % 10000000)
 3333299

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

Successfully merging this pull request may close these issues.

2 participants