<?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: How to update a double field from a text field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318943#M72121</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or if you don't want to use a code block... (substitute !junk! for your field name of course)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;float(!junk!) if !junk!.isnumeric() else None&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="float2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78160i02B994792B348341/image-size/medium?v=v2&amp;amp;px=400" role="button" title="float2.png" alt="float2.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;float2.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="float.png" style="width: 293px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78161i7D1CFB1FA184BD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="float.png" alt="float.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;float.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 22:47:13 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-08-15T22:47:13Z</dc:date>
    <item>
      <title>How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318902#M72114</link>
      <description>&lt;P&gt;I keep getting errors that it does not append when trying to do this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 20:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318902#M72114</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2023-08-15T20:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318907#M72115</link>
      <description>&lt;P&gt;You can't update the field type if there is data in the field.&lt;/P&gt;&lt;P&gt;Perhaps you can elaborate on what you are trying to do for alternate suggestions&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 21:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318907#M72115</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-15T21:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318909#M72116</link>
      <description>&lt;P&gt;i know that. the only work around was to create another field with the desired data type and fill it, however that is not working&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 21:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318909#M72116</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2023-08-15T21:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318916#M72117</link>
      <description>&lt;P&gt;Create a new Double field, then run Calculate Field with this Python expression (note the exclamation marks in line 2):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# NewField = 
convert(!OldField!)

# Code Block
def convert(x):
    try:
        return float(x)
    except:
        return None&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1692135413257.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78154iA1070471CAE68673/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1692135413257.png" alt="JohannesLindner_0-1692135413257.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JohannesLindner_0-1692135413257.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 21:38:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318916#M72117</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-15T21:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318943#M72121</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or if you don't want to use a code block... (substitute !junk! for your field name of course)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;float(!junk!) if !junk!.isnumeric() else None&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="float2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78160i02B994792B348341/image-size/medium?v=v2&amp;amp;px=400" role="button" title="float2.png" alt="float2.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;float2.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="float.png" style="width: 293px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78161i7D1CFB1FA184BD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="float.png" alt="float.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;float.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 22:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1318943#M72121</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-15T22:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319137#M72136</link>
      <description>&lt;P&gt;These sound great. My specific issue is related to pipe diameter. So they have the " inch sign attached to the numbers, and that may be why it is not going into the double field?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 14:55:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319137#M72136</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2023-08-16T14:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319165#M72139</link>
      <description>&lt;P&gt;Yes. If it can't convert the string into a number, the conversion will fail. You need to strip out the character:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# NewField = 
convert(!OldField!)

# Code Block
def convert(x):
    try:
        x = x.replace('"', '')
        return float(x)
    except:
        return None&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Aug 2023 15:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319165#M72139</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-16T15:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a double field from a text field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319189#M72142</link>
      <description>&lt;P&gt;Awesome, that seemed to do the trick, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 16:17:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-a-double-field-from-a-text-field/m-p/1319189#M72142</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2023-08-16T16:17:16Z</dc:date>
    </item>
  </channel>
</rss>

