Bugs item #2910776, was opened at 2009-12-08 17:05
Message generated for change (Tracker Item Submitted) made by luccat
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2910776&group_id=51305

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxJSON
Group: last released version
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Luciano Cattani (luccat)
Assigned to: Nobody/Anonymous (nobody)
Summary: [wxJSON <= 1.1] bug in writing double values

Initial Comment:
Hi all,
there is a bug in the wxJSONWriter class which does not write doubles correctly.
Try this:
{
        wxJSONValue root;
        root.Append( 90.3 );

        root.Append( 9.123456 );

        root.Append( 10.123456789 );
        root.Append( 0.1234 );
        

        wxString str;


        wxJSONWriter wrt;

        wrt.Write( root, str );

}

You get:

[
   90.300000,
   9.123456,
   10.123457,
   0.123400
]

The problem is in the snprintf() function which truncates the output of doubles 
at 6 digits of precision if a precision is not specified in the format string 
parameter.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=462816&aid=2910776&group_id=51305

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
wxCode-users mailing list
wxCode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxcode-users

Reply via email to