<?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: Arcpy Calculate Field Stores a String in Scientific Notation in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94691#M7378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to store the number as double and then use the code to covert to string.&amp;nbsp; As you point out, the number can't be stored in long.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Dec 2018 16:31:18 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2018-12-09T16:31:18Z</dc:date>
    <item>
      <title>Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94685#M7372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an attribute field that is API well numbers and when I calculate a "TEXT" field using arcpy it converts those API numbers into scientific notation. However, when I calculate the field in Arcmap using the GUI it stores the full API number correctly. Has anyone else had this issue? How might i ensure that this doesn't happen?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried both:&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(shapefile,fieldname,"!{}!".format(inputfieldname),"PYTHON")&lt;/P&gt;&lt;P&gt;and:&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(shapefile,fieldname,"str(!{}!)".format(inputfieldname),"PYTHON")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2018 19:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94685#M7372</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2018-12-07T19:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94686#M7373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give an example number?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2018 20:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94686#M7373</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-12-07T20:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94687#M7374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For instance, "30015364700000" will store as "3.00153647e+13".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2018 21:24:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94687#M7374</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2018-12-07T21:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94688#M7375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field width is &amp;gt; 14 characters and defined as Text for the output field?&lt;/P&gt;&lt;P&gt;The only other thing I can think of is explicitly formatting the output string&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;30015364700000&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"{:&amp;lt;14.0f}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94688#M7375</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T23:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94689#M7376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tried using your code with both a feature class and shape file, and it works correctly for me, i.e, it doesn't use scientific notation.&amp;nbsp; What version of ArcMap are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2018 16:42:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94689#M7376</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-12-08T16:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94690#M7377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If 'Long' in ArcMap or ArcGIS Pro is 32bit integers, then the maximum length of a field and the maximum value is dictated by the integer type.&amp;nbsp; From other c based number types, these are as follows&lt;/P&gt;&lt;P&gt;32bit integers 10 characters with the maximum as&amp;nbsp;2,147,483,647&lt;/P&gt;&lt;P&gt;Arc* stores long as&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;-2,147,483,648 to 2,147,483,647&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;64bit integers 19 characters with the maximum as 9,223,372,036,854,775,807&lt;/P&gt;&lt;P&gt;your number is 14 characters long as an integer, &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;30,015,364,700,000&lt;/SPAN&gt; .... beyond the 32bit long maximum&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if your key has to be that long, then you had better use a text field since&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;iinfo&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int32&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;max
&lt;SPAN class="number token"&gt;2147483647&lt;/SPAN&gt;

np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;iinfo&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int64&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;max
&lt;SPAN class="number token"&gt;9223372036854775807&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if we convert that integer you have to float32 (32 bit float) we get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;np.asarray([30015364700000]).astype(np.float32)&lt;BR /&gt;array([3.0015364e+13], dtype=float32)&lt;/P&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;np.asscalar(a)&amp;nbsp; # not good&lt;BR /&gt;30015364268032.0&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; min-height: 0px; orphans: 2; overflow: visible; position: static; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;DIV&gt;b =np.asarray([30015364700000]).astype(np.float64)&lt;/DIV&gt;&lt;DIV&gt;array([3.00153647e+13])&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; min-height: 0px; orphans: 2; overflow: visible; position: static; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt; &lt;/DIV&gt;&lt;DIV style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; min-height: 0px; orphans: 2; overflow: visible; position: static; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;np.asscalar(b)&amp;nbsp; # better&lt;BR style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; line-height: 25.95px; min-height: 0px; overflow: visible; position: static; padding: 0px; margin: 0px;" /&gt;30015364700000.0&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94690#M7377</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T23:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94691#M7378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to store the number as double and then use the code to covert to string.&amp;nbsp; As you point out, the number can't be stored in long.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Dec 2018 16:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94691#M7378</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-12-09T16:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94692#M7379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field width is 255 and is a string. The code you provided only works if i change the 'f' to 's'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 04:28:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94692#M7379</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2018-12-10T04:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94693#M7380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arc Version is 10.6.0.8321&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 04:34:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94693#M7380</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2018-12-10T04:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94694#M7381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field i am calculating from is a Double.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 04:34:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94694#M7381</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2018-12-10T04:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94695#M7382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the entire function:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CreateAPIText&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;inputfieldname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"API_Text"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Add field for string API&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Calculate value for API TEXT field&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!{}!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inputfieldname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94695#M7382</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2021-12-10T23:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94696#M7383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tested your code using the interactive Python window in ArcCatalog 10.6.1, and the results are as expected for both a feature class table and DBF table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="120" src="https://community.esri.com/legacyfs/online/431221_double_to_text.PNG" width="523" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 16:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94696#M7383</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-12-10T16:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94697#M7384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so i have narrowed it down to .format() causing the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code below&amp;nbsp;DOES NOT give me scientific notation as a result.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CreateAPIText&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;inputfieldname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"API_Text"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Add field for string API&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Calculate value for API TEXT field&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!API!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code below WAS outputing the fields in scientific notation.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CreateAPIText&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;inputfieldname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"API_Text"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Add field for string API&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="comment token"&gt;#Calculate value for API TEXT field&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shapefile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"!{}!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inputfieldname&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"PYTHON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, i can not seem to replicate the problem this morning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If if happens again I may be back but thanks to everyone for the input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94697#M7384</guid>
      <dc:creator>BrandonZaitz</dc:creator>
      <dc:date>2021-12-10T23:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Calculate Field Stores a String in Scientific Notation</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94698#M7385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bare formatting can cause some issues depending on what is first passed to it.&amp;nbsp; You can mitigate a bit by specifying how to treat numerics by prespecifying the size and decimals (even for integers)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = 30015364700000&lt;/P&gt;&lt;P&gt;"{:&amp;lt;16.0f}".format(a)&lt;/P&gt;&lt;P&gt;'30015364700000&amp;nbsp; '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with a space to spare&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 20:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-calculate-field-stores-a-string-in/m-p/94698#M7385</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-12-10T20:13:46Z</dc:date>
    </item>
  </channel>
</rss>

