Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mongo C Driver: Loosing decimal digits in QT application
Forum Updated to NodeBB v4.3 + New Features

Mongo C Driver: Loosing decimal digits in QT application

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 190 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christoph-LaBP
    wrote on last edited by
    #1

    When creating a bson from a json string with mongo c driver, decimal digits get lost when running in a QT environment in release mode.

    Whole issue, including a minimal example is described here: https://jira.mongodb.org/browse/CDRIVER-3626

    Unfortunately I did not get help so far, so I'm asking here, if anyone has an idea, what QApplication could change to produce the issue. Thanks a lot!

    aha_1980A 1 Reply Last reply
    0
    • C Christoph-LaBP

      When creating a bson from a json string with mongo c driver, decimal digits get lost when running in a QT environment in release mode.

      Whole issue, including a minimal example is described here: https://jira.mongodb.org/browse/CDRIVER-3626

      Unfortunately I did not get help so far, so I'm asking here, if anyone has an idea, what QApplication could change to produce the issue. Thanks a lot!

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      Hi @Christoph-LaBP,

      try this following snippet after creating the Q(Core)Application (you need to #include <locale.h>):

      const char *result = setlocale(LC_NUMERIC, "C");
      if (!result)
          fprintf(stderr, "Warning: cannot change LC_NUMERIC to 'C'!");
      

      This helped me in Linux to let printf output numeric dots instead commas. It looks like your issue is related.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • C Offline
        C Offline
        Christoph-LaBP
        wrote on last edited by
        #3

        YES :) Thank you very much! This fixed the issue!

        aha_1980A 1 Reply Last reply
        1
        • C Christoph-LaBP

          YES :) Thank you very much! This fixed the issue!

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Christoph-LaBP

          Super! Then please mark this topic as SOLVED (with the button Topic Tools).

          Thanks!

          Qt has to stay free or it will die.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved