<?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: Arcade expression round decimal to zero decimal places in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612542#M727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that's correct&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;values show two decimal zeros in the pop-up.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/433042_pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;In the configure attributes I do have zero decimal places selected:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433041_pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the actual db the GRIDCODE field is a double.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/433043_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2019 15:17:11 GMT</pubDate>
    <dc:creator>AndrewL</dc:creator>
    <dc:date>2019-01-11T15:17:11Z</dc:date>
    <item>
      <title>Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612540#M725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following Arcade expression. However, it does not round to the nearest whole number. It always produces a number with two decimal places. Not sure if I am doing something wrong? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var grid = $feature.GRIDCODE*10&lt;BR /&gt;var roundedValue = Round(grid, 0)&lt;BR /&gt;roundedValue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 21:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612540#M725</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2019-01-10T21:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612541#M726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess all your values show two decimal zeros in the pop-up, right? If this is a value that is shown in the attribute table, remember that with the configure attributes of the pop-up you define the number of decimals to be used. Since the Round function returns a value, you still have to provide the correct format (0 decimals) in the attribute configuration in the pop-up.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 12:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612541#M726</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-01-11T12:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612542#M727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that's correct&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;values show two decimal zeros in the pop-up.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/433042_pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;In the configure attributes I do have zero decimal places selected:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433041_pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the actual db the GRIDCODE field is a double.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/433043_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 15:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612542#M727</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2019-01-11T15:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612543#M728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not the input attribute that requires formatting but the expression (sorry for the Spanish screenshot, but you get the idea):&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="329" src="https://community.esri.com/legacyfs/online/433039_pastedImage_1.png" width="490" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 15:48:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612543#M728</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-01-11T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612544#M729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh I see it now. Thanks! Yes that worked.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 15:52:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612544#M729</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2019-01-11T15:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612545#M730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 15:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/612545#M730</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-01-11T15:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111349#M1047</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;, I am doing something similar but using the expression in a custom attribute display, and therefore do not have the option to round the result afterwards.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// call the sites feature layer&lt;BR /&gt;var sites = FeatureSetById($map, /* Sites */ "Test_site_layer_8539")&lt;/P&gt;&lt;P&gt;// establish spatial relationship between the two layers and return a count&lt;BR /&gt;var grids = Count(Intersects($feature, sites))&lt;/P&gt;&lt;P&gt;// round the result&lt;/P&gt;&lt;P&gt;var roundgrids = Round(grids, 0)&lt;BR /&gt;return roundgrids&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The test shows the number formatted correctly, but in the popups it still shows 2 decimal places. This is how the popup is formatted:&lt;/P&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="DataOfficer_0-1635268324633.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26227i5BE0BD1FF3059545/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DataOfficer_0-1635268324633.png" alt="DataOfficer_0-1635268324633.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 17:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111349#M1047</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2021-10-26T17:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111354#M1048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54030"&gt;@DataOfficer&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same applies. In the list of fields you will need to specify the decimals for the (virtual) field "expression/expr2".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 17:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111354#M1048</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-10-26T17:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111544#M1049</link>
      <description>&lt;P&gt;Ah got it, thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 08:21:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111544#M1049</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2021-10-27T08:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111594#M1050</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54030"&gt;@DataOfficer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;To avoid having to enter the list of fields and define how many decimals should be used you can use the Text function and format it the way you want. Have a look at the example below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var x1 = PI * 100;
Console(x1);
var x2 = Round(x1, 3);
Console(x2);
var x3 = Text(x2, "#.00");
Console(x3);
var x4 = Text(x2, "#");
Console(x4);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will write to the console:&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;314.1592653589793
314.159
314.16
314&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Contains the original value (PI * 100)&lt;/LI&gt;&lt;LI&gt;The result of rounding it to 3 decimals (it is still a number)&lt;/LI&gt;&lt;LI&gt;Converting to a text indicating to format it using always ("0") 2 decimals (even when 0)&lt;/LI&gt;&lt;LI&gt;Converting to a text using no decimals and eliminating leading/trailing zeros ("#")&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 27 Oct 2021 12:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111594#M1050</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-10-27T12:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111602#M1051</link>
      <description>&lt;P&gt;Excellent thank you. I appreciate your continued advice on this forum.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 13:24:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1111602#M1051</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2021-10-27T13:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1297063#M1236</link>
      <description>&lt;P&gt;I have the same problem.&lt;/P&gt;&lt;P&gt;What I did was I create a new field (Double) field calculate all for my (Short )field. In ArcGISPro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Web Map: I went to pop up and put "0 decimal Places". and resolve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YanisleyGuilarte_0-1686227357243.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72643i26E0E468DAC7C7CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YanisleyGuilarte_0-1686227357243.png" alt="YanisleyGuilarte_0-1686227357243.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SO the field has to be DOUBLE&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YanisleyGuilarte_1-1686227466995.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72644i8B1102D8F4CAF354/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YanisleyGuilarte_1-1686227466995.png" alt="YanisleyGuilarte_1-1686227466995.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:31:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1297063#M1236</guid>
      <dc:creator>YanisleyGuilarte</dc:creator>
      <dc:date>2023-06-08T12:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression round decimal to zero decimal places</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1317732#M1263</link>
      <description>&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;Is there a way to use Arcade to limit which number values show trailing zeros? For example, I want to use a number attribute for labelling. Some numbers have decimals values (e.g. 110.5), but must are whole numbers. Is there an Arcade expression I can use so we only see decimal values for values with decimals NOT zero (e.g. see values as 1, 2, 3, not 1.0, 2.0, 3.0)? I also want to avoid seeing zeros after decimals in popups.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 23:26:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-round-decimal-to-zero-decimal/m-p/1317732#M1263</guid>
      <dc:creator>WillAnderson</dc:creator>
      <dc:date>2023-08-10T23:26:13Z</dc:date>
    </item>
  </channel>
</rss>

