<?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: Function to format numbers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782969#M337396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anyi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM will do rounding into 2 decimals then you need to fill zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 18:52:40 GMT</pubDate>
    <dc:creator>ferry_lianto</dc:creator>
    <dc:date>2006-12-06T18:52:40Z</dc:date>
    <item>
      <title>Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782965#M337392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to write a function that does the following 2 things:&lt;/P&gt;&lt;P&gt;If a number is an integer, first add .00 after the integer, then add zeros in front such that altoghther it makes 9 characters (e.g.: 12 -&amp;gt; 000012.00)&lt;/P&gt;&lt;P&gt;If a number is not an integer, then ensure it is 2 decimals by truncating whatever that is after the 2 decimals and add 0 in fron as well (e.g. 12.12345 -&amp;gt; 000012.12)&lt;/P&gt;&lt;P&gt;There would be no number larger than 6 digits (i.e., 9 characters altogether)&lt;/P&gt;&lt;P&gt;Does anyone know whether there is any existing function or method that would do the job or at least part of it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anyi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782965#M337392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T18:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782966#M337393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check FM HR_NL_ROUNDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782966#M337393</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-12-06T18:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782967#M337394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;So now the rounding and 2 decimal bit is resolved, anyone has any suggestion regarding the adding zero part?&lt;/P&gt;&lt;P&gt;Thanks Ferry for the suggestion!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anyi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Please check FM HR_NL_ROUNDING.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:45:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782967#M337394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T18:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782968#M337395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use Function module "ROUND"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Raja T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:49:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782968#M337395</guid>
      <dc:creator>raja_thangamani</dc:creator>
      <dc:date>2006-12-06T18:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782969#M337396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anyi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM will do rounding into 2 decimals then you need to fill zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:52:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782969#M337396</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-12-06T18:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782970#M337397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Err...I am more concerned with the 0s in front now...&lt;/P&gt;&lt;P&gt;Thanks anyways!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; use Function module "ROUND"&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Raja T&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Message was edited by: &lt;/P&gt;&lt;P&gt;&amp;gt;         Raja T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 18:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782970#M337397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T18:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Function to format numbers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782971#M337398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anyi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: NUM       TYPE P05_DEC15_4,
      ROUND     TYPE  MAXBT,
      RESULT(10) TYPE C.
                                                                        
MOVE '12.12345' TO NUM.
                                                                        
CALL FUNCTION 'HR_NL_ROUNDING'
  EXPORTING
    INPUT  = NUM
    METHOD = '1'
  IMPORTING
    OUTPUT = ROUND.
                                                                        
MOVE ROUND TO RESULT.
SHIFT RESULT RIGHT.
TRANSLATE RESULT USING ' 0'.
WRITE: / RESULT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 19:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-to-format-numbers/m-p/1782971#M337398</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-12-06T19:05:40Z</dc:date>
    </item>
  </channel>
</rss>

