Hi
I would like to suggest a new JSON function:
Result$ = GetJSONRaw(JSONVALUE)
This would be useful in deciding how numeric values should be handled. If Result$ = "13.0" then you could convert the value to a double. If the Result$ = "13" you could convert the number to an integer.
Simon
GetJSONRaw(JSONValue)
GetJSONRaw(JSONValue)
Simon White
dCipher Computing
dCipher Computing
Re: GetJSONRaw(JSONValue)
+1
but with a slight suggestion
Really your request is for numbers, right? Like for the value 13, you want the original "13.000" as it's written.
That's not useful for the other JSON types: null is always "null", boolean is always "true" or "false", string is already a string, object and array are container structures.
So I suggest: instead of adding a new function, just extend GetJSONString() to accept JSON nodes of type "number" too, to return its original string. Simple, IMHO.
but with a slight suggestion
Really your request is for numbers, right? Like for the value 13, you want the original "13.000" as it's written.
That's not useful for the other JSON types: null is always "null", boolean is always "true" or "false", string is already a string, object and array are container structures.
So I suggest: instead of adding a new function, just extend GetJSONString() to accept JSON nodes of type "number" too, to return its original string. Simple, IMHO.
Re: GetJSONRaw(JSONValue)
Yes extending GetJSONString() would definitely work. I just thought that a new function would better ensure no backward compatibility issues.
Simon
Simon
Simon White
dCipher Computing
dCipher Computing
- the.weavster
- Addict
- Posts: 1537
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England