Query Task Adding extra decimal places

2187
3
Jump to solution
02-25-2011 10:56 AM
by Anonymous User
Not applicable
Original User: ggunther

I have a simply query task which is returning more decimal places with an extra bit of data that what exists in the field itself.  See the attached screen captures.  The first is the data table in ArcMap illustrating a value of 424.28 and the second is the json response from the query task showing the value as 424.280000000003.  Any thoughts?  I dont want to round because there are significant figures that I need to honor.

0 Kudos
1 Solution

Accepted Solutions
BillDaigle
Occasional Contributor III

The problem is associated with how the ArcGIS server (python) handles floating point numbers: 14. Floating Point Arithmetic: Issues and Limitations — Python 2.7.11 documentation

As far as I know, the only recourse is to round the result.   

View solution in original post

3 Replies
Ranga_Tolapi
Occasional Contributor III

Can you please share the solution, if you got any?

0 Kudos
thejuskambi
Occasional Contributor III

It depends on what you are trying to achieve. For e.g. If you want to round them in InfoWindow. The popup template has options which you can set to show only that number of places.

0 Kudos
BillDaigle
Occasional Contributor III

The problem is associated with how the ArcGIS server (python) handles floating point numbers: 14. Floating Point Arithmetic: Issues and Limitations — Python 2.7.11 documentation

As far as I know, the only recourse is to round the result.