<?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>How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/discussions/f/general/30559/how-to-store-and-show-7-digit-after-decimal-using-number-decimal-data-type</link><description>Hi All, 
 I need to show and store 7 digits after decimal and before decimal its &amp;#39;n&amp;#39; number and the data type is number(decimal) how I can do that? 
 Thanks in advance.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121468?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 09:16:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8cb0d653-eda5-4158-b385-674d20f014bd</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Ok, so you need to separate in your mind how the data is held in memory (this will be using a Decimal data type) from how you want it captured/presented to the user. This code snippet might help:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!textField(
    label: &amp;quot;My Decimal&amp;quot;,
    value: fixed(ri!myDecimal,7),
    saveInto: {
      a!save(
        ri!myDecimal,
        if(
          fn!regexmatch(
            &amp;quot;^\d*(\.\d+)?$&amp;quot;,
            save!value,
            &amp;quot;i&amp;quot;
          ),
          save!value,
          0
        )
      ),
    }
  ),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The ri!myDecimal is of type Number(Decimal) but as you can see I&amp;#39;m using a Text Field to allow the user to enter their value.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where the text entered conforms to the pattern of a Decimal (that&amp;#39;s what the RegEx expression is checking) then it is presented as a Decimal with 7 digits after the decimal point (that&amp;#39;s what the fixed() function is doing)&lt;/p&gt;
&lt;p&gt;Because the input field is text you need to handle the fact that a user might enter non-decimal representations e.g. &amp;quot;ABC&amp;quot;. That&amp;#39;s what the second part of the if() statement is doing.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121458?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 07:39:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:028c2a30-e3cb-4ce0-9c59-fe87fde1e0bb</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Appian uses&amp;nbsp;double precision floating-point decimal numbers to store your decimal numeric values. Always and in all places!&lt;/p&gt;
&lt;p&gt;When Appian displays that value to you, on screen, in a text form, it rounds it to two decimals by default. To change that, you can use the text() function which then returns text.&lt;/p&gt;
&lt;p&gt;If you want to modify the underlying data value, use round().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121454?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 06:19:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15de7150-50ac-49f2-997a-31e35d9f1e00</guid><dc:creator>suyogk0001</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1699424326578v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;It is taking only this digits&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121453?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 06:00:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:94643a6c-cb7b-4e96-a895-44c3f9e9c06c</guid><dc:creator>kishore nanda</dc:creator><description>&lt;p&gt;todecimal(text(ri!decimal, &amp;quot;0.0000000&amp;quot;))&lt;/p&gt;
&lt;p&gt;i think it will work for your requirement&lt;/p&gt;
&lt;p&gt;please check&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121449?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 04:36:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:512ba2d2-ddf7-49ba-bd45-c3b0a78ee27e</guid><dc:creator>suyogk0001</dc:creator><description>&lt;p&gt;Thanx for the reply&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but it will return text right, I want number decimal to be return will it possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121448?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 04:32:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:79ba1c0c-c724-4c56-b2bd-6a48ec61c877</guid><dc:creator>suyogk0001</dc:creator><description>&lt;p&gt;Thanx For the reply Stewart&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If user enter 12345.1234567899 then in UI it should show and store only 1234.1234567&lt;/p&gt;
&lt;p&gt;if enter 123456.12 it will show as it is, only after 7 digits it will not show&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121440?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 17:30:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:08581a25-cd87-4277-aae1-7cd534b80b13</guid><dc:creator>jesush905075</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;text(ri!decimal,&amp;quot;0.0000000&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can use this code to show a decimal number as text with&amp;nbsp;the required format&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121439?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 16:57:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:03541b62-b825-499a-a0d9-8794c0af06d4</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Do&amp;nbsp;you want to allow the user to enter any number but always have it be presented in the User Interface always with the full 7 digits after the decimal point? Examples:&lt;/p&gt;
&lt;p&gt;Enter: 123&amp;nbsp; -&amp;gt; presented as 123.0000000&lt;/p&gt;
&lt;p&gt;Enter: 12.12345678 -&amp;gt; presented as&amp;nbsp;12.1234568&lt;/p&gt;
&lt;p&gt;Enter: .2 -&amp;gt; presented as&amp;nbsp;0.2000000&lt;/p&gt;
&lt;p&gt;Is that the requirement?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to store and show 7 digit after decimal using number(decimal) data type</title><link>https://community.appian.com/thread/121437?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 16:47:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e3dfd23b-453a-4cc6-ab9e-b731fc0aa000</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I am not sure what you are looking for.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.3/Appian_Data_Types.html#number-(decimal)"&gt;https://docs.appian.com/suite/help/23.3/Appian_Data_Types.html#number-(decimal)&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>