<?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: Field Calculator Python Syntx (combining floating point and string) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529620#M41480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To make a comma delimited number with no decimal places do this in a Python calculation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'{0:,.0f}'.format(Prev_Total) + ' boxes collected'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Oct 2013 14:57:58 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2013-10-03T14:57:58Z</dc:date>
    <item>
      <title>Field Calculator Python Syntx (combining floating point and string)</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529617#M41477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not familiar with python and I have a basic question about simple field calculations in python rather than VB. This is needed because I have a model I am exporting to python for task scheduler. My model runs fine in ArcMap but when I run it as a python script it cannot complete the field calculation in VB expression form. Any help converting the following to a python expression would be appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;VB Expression to convert (field is stored as float):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[Prev_Total] &amp;amp; " boxes collected"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is to be calculated in a string field.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 11:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529617#M41477</guid>
      <dc:creator>Mtclimber03</dc:creator>
      <dc:date>2013-10-03T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator Python Syntx (combining floating point and string)</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529618#M41478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm not familiar with python and I have a basic question about simple field calculations in python rather than VB. This is needed because I have a model I am exporting to python for task scheduler. My model runs fine in ArcMap but when I run it as a python script it cannot complete the field calculation in VB expression form. Any help converting the following to a python expression would be appreciated&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;VB Expression to convert (field is stored as float):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;[Prev_Total] &amp;amp; " boxes collected"&lt;BR /&gt;&lt;BR /&gt;--------------------------------------&lt;BR /&gt;This is to be calculated in a string field.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;str(!Prev_Total!) + " boxes collected"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 12:22:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529618#M41478</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-10-03T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator Python Syntx (combining floating point and string)</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529619#M41479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok this worked but with one issue. When the field was calculated it pulled over a decimal place that was not happening in VB. For example I am seeing &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;1678.0 boxes collected&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to have the expression in python use zero decimals? i.e I am looking for the result of &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;1678 boxes collected&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or better yet &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;1,678 boxes collected&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 13:15:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529619#M41479</guid>
      <dc:creator>Mtclimber03</dc:creator>
      <dc:date>2013-10-03T13:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator Python Syntx (combining floating point and string)</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529620#M41480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To make a comma delimited number with no decimal places do this in a Python calculation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'{0:,.0f}'.format(Prev_Total) + ' boxes collected'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 14:57:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-python-syntx-combining-floating/m-p/529620#M41480</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-10-03T14:57:58Z</dc:date>
    </item>
  </channel>
</rss>

