Skip to content

Fix Decimal128 conversion #34

Open
Open

Description

@noisersup

Currently, when we convert wirebson.Decimal128 value to the JavaScript representation, we do:
https://github.com/OpenDocDB/cts/blob/main/opendocdb-cts/internal/mongosh/mongosh.go#L121-L122

This is incorrect, and results in different value than expected. The H, and L represent the most significant and least significant bits of 128-bit IEEE 754-2008 decimal floating value.

The fix could be done on cts layer, but we could also consider extending wire/wirebson package with a new function.

Where

  • TODO comments referencing this issue,
  • integration tests skipped with reference.

Activity

  1. added theissue type on Apr 16, 2025
  2. AlekSi commented on Apr 16, 2025

    @AlekSi
    Contributor

    Isn't it the same as #22?

  3. noisersup commented on Apr 16, 2025

    @noisersup
    CollaboratorAuthor

    @AlekSi I don't think so. The problem that exists here is related to our way of converting wirebson Decimal128 into mongosh JS. The #22 doesn't involve any wirebson->mongosh conversion.

  4. AlekSi commented on Apr 16, 2025

    @AlekSi
    Contributor

    The #22 doesn't involve any wirebson->mongosh conversion.

    I don't follow. The title of #22 literally starts with "Fixture conversion to mongosh".

  5. noisersup commented on Apr 16, 2025

    @noisersup
    CollaboratorAuthor

    I see, then yeah, I think those might be related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions