|
-
Jan 17th, 2017, 11:54 AM
#11
Re: VB6 - JsonBag, Another JSON Parser/Generator
As it says in the documention (not included in the example above but in the other uploads before it):
DecimalMode As Boolean [read/write]
Defaults to False.
The setting of this property determines how numbers are parsed and serialized. See the discussion Impact Of DecimalMode Setting above.
This should only be set on a JsonBag instance that is being used as a "root" document node when it is empty.
So most JSON parsers deal with it one way or another, and that's how JsonBag does it. The default is Double which is what the spec calls for even though that is widely violated. JSON inherits the weak type system of JavaScript.
Slopping a "number" into an Integer for example can lead to unexpected overflows when somebody works with it. That's one of the reasons why trying to get clever can blow up in users' faces. Badly.
But you have to make a decision one way or the other, and that's just how the JSON game goes.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|