Solved Mongo C Driver: Loosing decimal digits in QT application
-
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!
-
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
-
YES :) Thank you very much! This fixed the issue!
-