Problem with the bson2json conversion dealing with doubles #135

Closed
adamansky opened this Issue Apr 24, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@adamansky
Member

adamansky commented Apr 24, 2015

I'm using tcejdb-1.1.25-mingw32-i686 and have encountered a problem with the bson2json conversion dealing with doubles.
Here's what I'm seeing:

    bson bo_test;
    bson_init(&bo_test);
    bson_append_int(&bo_test, "myInt", 10);
    bson_append_double(&bo_test, "myDouble", -50.0);
    bson_finish(&bo_test);

    char* buf;
    int lenght;

    bson2json(bson_data(&bo_test), &buf, &lenght);

The contents of buf are as follows:
{
    "myInt" : 10,
    "myDouble" : -./,),(-*,(.000000
}

I see this same issue when using the ejdbexport API with the JBJSONEXPORT flag.

Is this a known issue? Am I doing something wrong? Any help would be appreciated.

Thanks,

Marcos

@adamansky adamansky closed this in 639eabf Apr 27, 2015

adamansky added a commit that referenced this issue Apr 27, 2015

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