Search code examples
c#jsonopen-sourceroundingcouchbase

Couchbase value rounding issue?


When I try to save json in Couchbase Document it will rounding value by default?

This is the Json I'm try to save

 {"GUDeviceID": "15091920083214800501",  "GUProductID": 15091218260779201}

After save, the couch document shows like this

 {"GUDeviceID": "15091920083214800501",  "GUProductID": 15091218260779200}
  • GUProductID Rounding 15091218260779201 = > 15091218260779200

  • When I retrieve data using Couchbase.dll (C#) it will return 15091218260779200 as GUProductID

Please help me to solve this, Thanks


Solution

  • Use get function in Couchbase dll. It will return correct value without rounding. This issue occurred when javascript rounding the decimal value.