<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Need to restrict upto 2 decimal places</title><link>https://community.appian.com/discussions/f/user-interface/40179/need-to-restrict-upto-2-decimal-places</link><description>Hi All, 
 i have floatingpoint field in my UI, i want to restrict user from typing values upto 2 decimal point and Below is my expected results 
 
 If the user enters 12, it will be rounded off to 12.00 
 If the user enters 12.1, it will be rounded off</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153686?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 08:12:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:311ee02e-b34c-49eb-a2b6-763672c80069</guid><dc:creator>Anitha Dharmalingam</dc:creator><description>&lt;p&gt;Thanks &lt;a href="/members/shubhama926776"&gt;Shubham Aware&lt;/a&gt;&amp;nbsp;for sharing the knowledge.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153685?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 01:49:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63e10669-0f95-479d-aaf8-9dfe6faf554b</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Yes, you&amp;#39;re correct. With validation, floatingPointField always strips trailing zeros (12 stays 12, not 12.00) because formatting with text(value, &amp;quot;0.00&amp;quot;) converts to string and breaks number input.&lt;br /&gt;Validation = editable but no .00 display ; Formatting = shows .00 but not editable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153671?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 12:09:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0ec1397-df27-4087-9721-d39ec5cd9149</guid><dc:creator>Anitha Dharmalingam</dc:creator><description>&lt;p&gt;Yes &lt;a href="/members/shubhama926776"&gt;Shubham Aware&lt;/a&gt;&amp;nbsp; it works Thanks. out of curiosity i have one question. if we go with validation we cant keep the 2 digit formatting right?&amp;nbsp; means if user enters 12, we cannot show 12.00 or if 12.1 wont be able to show 12.10 . because then it will restrict user from typing more values right. please correct me if i am wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153665?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2026 07:59:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9972eb86-abba-4661-9680-a07ccba95f9d</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Check this&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dentalPremium: null,
  {
    a!floatingPointField(
      label: &amp;quot;Dental Premium (Annual)&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      value: local!dentalPremium,
      saveInto: a!save(local!dentalPremium, save!value),
      refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
      validations: if(
        and(
          a!isNotNullOrEmpty(local!dentalPremium),
          mod(local!dentalPremium * 100, 1) &amp;lt;&amp;gt; 0
        ),
        &amp;quot;Please enter a value with up to 2 decimal places (e.g., 12, 12.1, or 12.67)&amp;quot;,
        null
      )
    ),
    a!textField(
      label: &amp;quot;Current Value (Debug)&amp;quot;,
      value: local!dentalPremium,
      readOnly: true
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153663?ContentTypeID=1</link><pubDate>Thu, 19 Feb 2026 14:27:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2986ff15-c260-4c27-b37e-15433a74bd2f</guid><dc:creator>Anitha Dharmalingam</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data,
  a!floatingPointField(
    label: &amp;quot;Dental Premium (Annual)&amp;quot;,
    labelPosition: &amp;quot;ABOVE&amp;quot;,
    value: local!data,
    saveInto: {
      a!save(
        local!data,
        if(
          a!isNotNullOrEmpty(todecimal(save!value)),
          (save!value),
          todecimal(null())
        )
      ),

    },
    refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
    validations: {
      if(
        not(
          regexMatch(&amp;quot;^[0-9]*\.[0-9]{2}$&amp;quot;, local!data)
        ),
        &amp;quot;Please enter a valid number with up to 2 decimal places.&amp;quot;,
        {}
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp;&lt;a href="/members/shubhama926776"&gt;Shubham Aware&lt;/a&gt;&amp;nbsp;. Thank you for the help, it works well. But here now user dont want to truc the values instead of that expecting to show the validation so that they will give what they want either they want rounded value or raw data.&lt;br /&gt;&lt;br /&gt;For that i tried using below regexMatch function for the validation, but the issue is it is throwing validations if we give round values (123)or 1 decimal values (12.10). Can you please help how to show validation only when they enter more then 2 decimal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153516?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2026 13:11:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0df765e0-34e8-4e8b-8959-649622814515</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Oops - my null check in the saveInto should have done the null test against the &amp;quot;todecimal&amp;quot; version of the save!value just to make sure it contained anything valid after invalid characters are stripped out.&amp;nbsp; Here&amp;#39;s mine again but with that one function added back in, and it works even when junk, text-only, or mixed (number and text) info is entered.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!testDecimal: null(),

  a!textField(
    label: &amp;quot;Fake decimal entry&amp;quot;,
    refreshAfter: &amp;quot;KEYPRESS&amp;quot;,
    placeholder: &amp;quot;Enter Decimal Value&amp;quot;,

    value: if(
      a!isNullOrEmpty(local!testDecimal),
      null(),
      fixed(local!testDecimal, 2)
    ),
    saveInto: {
      a!save(
        local!testDecimal,
        if(
          a!isNotNullOrEmpty(todecimal(save!value)),
          todecimal(trunc(todecimal(save!value), 2)),
          todecimal(null())
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153503?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2026 08:43:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4961c9bd-7210-4694-82cf-a3004eb6f8a9</guid><dc:creator>Anitha Dharmalingam</dc:creator><description>&lt;p&gt;Thanks &lt;a href="/members/shubhama926776"&gt;Shubham Aware&lt;/a&gt;&amp;nbsp; and &lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp; .. using this i was able to achieve 80% but if i gave&amp;nbsp;alphabets its throws error and it breaks the screen. Instead of that how can we show validation message .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153498?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2026 05:33:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:16f7092a-6fb4-45b0-9f4e-0a93ffec2798</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;a!floatingPointField cannot restrict decimal input during typing because it lacks a decimalPlaces parameter and relies on native browser number input behavior.&lt;br /&gt;Try this&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dentalPremium: null,
  a!textField(
    label: &amp;quot;Dental Premium (Annual)&amp;quot;,
    labelPosition: &amp;quot;ABOVE&amp;quot;,
    refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
    value: if(
      a!isNullOrEmpty(local!dentalPremium),
      null,
      text(local!dentalPremium, &amp;quot;0.00&amp;quot;)
    ),
    saveInto: a!save(
      local!dentalPremium,
      if(
        a!isNullOrEmpty(save!value),
        null,
        floor(todecimal(save!value) * 100) / 100
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153493?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2026 16:38:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3ba972cf-11f6-4d2a-8bed-734fbff2c60f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Example provided: we&amp;#39;re using &amp;quot;fixed&amp;quot; for the display-time to make sure all decimal places are DISPLAYED even when they are zero.&lt;/p&gt;
&lt;p&gt;(note: you do not need to STORE these extra places in the &amp;quot;decimal&amp;quot; data, as it is actually impossible to do so - if it should be SHOWN to the end user, it&amp;#39;s up to you to do that on the user-facing side.)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Save into&amp;quot; is null-checked and truncated to 2 decimal places upon entry.&amp;nbsp; As I mentioned originally, of course, nothing can really keep the user from entering extra spam digits after the decimal place, but they are not saved.&amp;nbsp; I don&amp;#39;t know of any good workaround for that unfortunately - if you were dedicated to it, you could look into using the &amp;quot;character count&amp;quot; feature, but I don&amp;#39;t know if you&amp;#39;d be able to update it dynamically enough to account for different values ahead of the decimal point.&lt;br /&gt;&lt;img height="116" src="/resized-image/__size/854x232/__key/communityserver-discussions-components-files/13/pastedimage1770827748850v1.png" width="427" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!testDecimal: null(),

  a!textField(
    label: &amp;quot;Fake decimal entry&amp;quot;,
    refreshAfter: &amp;quot;KEYPRESS&amp;quot;,
    placeholder: &amp;quot;Enter Decimal Value&amp;quot;,

    value: if(
      a!isNullOrEmpty(local!testDecimal),
      null(),
      fixed(local!testDecimal, 2)
    ),
    saveInto: {
      a!save(
        local!testDecimal,
        if(
          a!isNotNullOrEmpty(save!value),
          todecimal(trunc(todecimal(save!value), 2)),
          todecimal(null())
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to restrict upto 2 decimal places</title><link>https://community.appian.com/thread/153491?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2026 16:26:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb26af27-ef46-4993-b0f2-08754f4a7be3</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Easiest to just use a Text Field and sanitize the input similarly to how you already are.&amp;nbsp; You won&amp;#39;t be able to prevent the user from typing some gibberish into the field, but you can at least instantly justify it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>