<?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: Labeling and an extra zero in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130167#M43593</link>
    <description>&lt;P&gt;Just to follow up, it was a combination of issues.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Your &lt;STRONG&gt;Text&lt;/STRONG&gt; function included the hyphen and percentage as part of the &lt;EM&gt;formatting string&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Your formatting string included a "%" as a result of #1&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It's lower down in the Function Reference page, but you can see that when "%" appears in the formatting string, it will &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#multiply-by-100-and-format-as-percentage" target="_self"&gt;multiply by 100 and format as a percentage&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1641245137779.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30655i736F5A52E11755E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1641245137779.png" alt="jcarlson_0-1641245137779.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By moving the parenthesis, the "%" is no longer in the formatting string, and the function won't trigger the multiplying by 100.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jan 2022 21:27:07 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-01-03T21:27:07Z</dc:date>
    <item>
      <title>Labeling and an extra zero</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130107#M43585</link>
      <description>&lt;P&gt;Good afternoon, I am running into an issue when labeling on the new map viewer. For some reason, my arcade script is adding zeros onto a currency field.&amp;nbsp; Below is my script. Can anyone advise me on what I may be doing wrong. Thanks.&amp;nbsp; Below is my scripts&lt;/P&gt;&lt;P&gt;if ($feature.Change &amp;gt; 0 ) {return Text($feature["Change"], '$##,###,###' + ' - '+ Round(($feature["F__Change"])*100,2)+ "%")}&lt;/P&gt;&lt;P&gt;This turns a value of $1,900 into $190,000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 17:46:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130107#M43585</guid>
      <dc:creator>JasonSimpson</dc:creator>
      <dc:date>2022-01-03T17:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling and an extra zero</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130135#M43591</link>
      <description>&lt;P&gt;Does the expression evaluate properly in other contexts, like in Pro or a Dashboard? At a glance, it looks like you're missing a closing parenthesis after your text formatting string.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;return Text($feature["Change"], '$##,###,##&lt;U&gt;#' +&lt;/U&gt;...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm only working with hard-coded variables, since I don't have a layer handy to test this on, but I can't replicate the issue:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1641236748565.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30643i7E411D4AF00C0366/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1641236748565.png" alt="jcarlson_0-1641236748565.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What you might try, though, is to establish variables and use &lt;STRONG&gt;template literals&lt;/STRONG&gt; for your string, and see if that behaves any differently. At the very least, it's a nicer way of writing strings with multiple parts.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var c = $feature["Change"];
var f = $feature["F__Change"];

if (c &amp;gt; 0 ) {
    return `${Text(c, '$##,###,###')} - ${Round(f * 100, 2)}%`
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 19:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130135#M43591</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-03T19:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Labeling and an extra zero</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130167#M43593</link>
      <description>&lt;P&gt;Just to follow up, it was a combination of issues.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Your &lt;STRONG&gt;Text&lt;/STRONG&gt; function included the hyphen and percentage as part of the &lt;EM&gt;formatting string&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Your formatting string included a "%" as a result of #1&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It's lower down in the Function Reference page, but you can see that when "%" appears in the formatting string, it will &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#multiply-by-100-and-format-as-percentage" target="_self"&gt;multiply by 100 and format as a percentage&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1641245137779.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30655i736F5A52E11755E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1641245137779.png" alt="jcarlson_0-1641245137779.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By moving the parenthesis, the "%" is no longer in the formatting string, and the function won't trigger the multiplying by 100.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 21:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/labeling-and-an-extra-zero/m-p/1130167#M43593</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-03T21:27:07Z</dc:date>
    </item>
  </channel>
</rss>

