<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99460#M7702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan but is to possible to add the unit abbreviation eg.1.23 Ha &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 12:02:43 GMT</pubDate>
    <dc:creator>KelvinMwakomo</dc:creator>
    <dc:date>2016-03-02T12:02:43Z</dc:date>
    <item>
      <title>Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression.</title>
      <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99458#M7700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys&lt;/P&gt;&lt;P&gt;I want to use the Field Calculator in ArcMap to round an existing column to two decimals. Currently I have a column (AREA_Ha) that is 3 decimal places long and would like to simply round it down to 2 decimals.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sreen.JPG" class="image-1 jive-image" height="431" src="https://community.esri.com/legacyfs/online/188382_sreen.JPG" style="height: 433px; width: 836.324px;" width="832" /&gt;&lt;/P&gt;&lt;P&gt;I have tried this ( &lt;CODE&gt;&lt;SPAN class="pln"&gt;round&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(!&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;AREA_Ha&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;!,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;))&lt;/SPAN&gt;&lt;/CODE&gt; but get this error message " There was a failure during processing, check the Geoprocessing Results window for details&lt;CODE&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pun"&gt;&lt;IMG alt="sreen1.JPG" class="image-2 jive-image" height="445" src="https://community.esri.com/legacyfs/online/188383_sreen1.JPG" style="height: 453px; width: 845.461px;" width="832" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pun"&gt;Your help please.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 06:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99458#M7700</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-02T06:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression.</title>
      <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99459#M7701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that is because your area field was made into a string.&lt;/P&gt;&lt;P&gt;You can tell because it is left justified and contains 'ha' at the end. So however you created the area field wasn't a true area field but the representation of an area field.&lt;/P&gt;&lt;P&gt;The most descriptive is to follow&lt;/P&gt;&lt;P&gt;a = '1.2345 ha'&lt;/P&gt;&lt;P&gt;round(float(a.split(" ")[0]),2)&lt;/P&gt;&lt;P&gt;yields 1.23&lt;/P&gt;&lt;P&gt;where 'a' is your field name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 10:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99459#M7701</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-02T10:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression.</title>
      <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99460#M7702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan but is to possible to add the unit abbreviation eg.1.23 Ha &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99460#M7702</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-02T12:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression.</title>
      <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99461#M7703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;str(round(float(a.split(" ")[0]),2) ) + " ha"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is getting ridiculously convoluted, the area calculation should have been sent to a numeric field, rounding there, and then, converted to string in a subsequent field&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:19:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99461#M7703</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-02T12:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Round values in an attribute table to the nearest nth value using the Field Calculator and a Python expression.</title>
      <link>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99462#M7704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan for your assistance&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/round-values-in-an-attribute-table-to-the-nearest/m-p/99462#M7704</guid>
      <dc:creator>KelvinMwakomo</dc:creator>
      <dc:date>2016-03-02T12:32:35Z</dc:date>
    </item>
  </channel>
</rss>

