iphone - How Core Data save NSNnumber data without rounding the decimal part in Objective-C -


i trying save decimal number core data nsnumber object decimal value had saved rounding digits when enter 5 digit number decimal part.

if enter 9999,999 getting save same value database in case of 5 digit (e.g.,10000.999) save 10001 in database.

chargefloat=10000.999;  value.fees      = [nsnumber numberwithfloat:chargefloat];//value entity object                                                           //fees nsnumber 

but in database showing value 10001.

i need solution.

floats give 6 9 significant digits, doubles give 15 17 significant digits , nsdecimal gives 38 significant digits. suggest either use doubles of nsdecimals.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -