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

Pull out data related to my apps from Android Play Store and iOS App Store -

Change php variable from jquery value using ajax (same page) -

How can I fetch data from a web server in an android application? -