ios - NSJSONSerialization output number as float? -


i'm using nsjsonserialization convert dictionary json.

if include nsdecimalnumber ( == 0 ) in dictionary outputs 0. wrong. 0 int. need output 0.0.

this i'm doing:

nsdecimalnumber *decimal = [[nsdecimalnumber alloc] initwithfloat:0.0f]; // when fed nsjsonserialization outputs 0 

is there way output 0.0?

or incorrect in assumption? 0 valid float?

there no way affect way nsjsonserialization outputs numbers. should not worry this. json doesn’t distinguish between different types of numbers, should accept numbers , without decimal points, no matter actual type of number doing calculations with.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -