<?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: Changing decimal places in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504670#M233312</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;&lt;/P&gt;&lt;P&gt;data z type i value 10000.&lt;/P&gt;&lt;P&gt;data x type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = itab-val / i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Andreas Mann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Sep 2006 07:47:31 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2006-09-06T07:47:31Z</dc:date>
    <item>
      <title>Changing decimal places</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504668#M233310</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;I have a requirement in which I need to change the decimal place of a packed number. The value should not be rounded off. The decimal should be placed after the 10 thousandth place. &lt;/P&gt;&lt;P&gt;For eg. 3349544.88 should be displayed as 33.49. &lt;/P&gt;&lt;P&gt;Please help! Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 07:20:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504668#M233310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T07:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing decimal places</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504669#M233311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Jonathan,&lt;/P&gt;&lt;P&gt;If you are fixed with the number of digits, you can divide the result by a constant to get your answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 07:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504669#M233311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T07:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing decimal places</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504670#M233312</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;&lt;/P&gt;&lt;P&gt;data z type i value 10000.&lt;/P&gt;&lt;P&gt;data x type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = itab-val / i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Andreas Mann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 07:47:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504670#M233312</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2006-09-06T07:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing decimal places</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504671#M233313</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;Use can try with this piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: v_pack(10) type p decimals 2 value '3349544.8',
       v_str(10) type c.

unpack v_pack to v_str.
shift v_str right by 5 places.
pack v_str to v_pack.
set country 'US'.
write :/ v_pack.        "33.49
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 07:52:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504671#M233313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T07:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing decimal places</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504672#M233314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below logic would work...if you always have 2 decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unpack lval to lchr.&lt;/P&gt;&lt;P&gt;shift lchr right by 5 places.&lt;/P&gt;&lt;P&gt;write : / lchr using edit mask 'RR_____.__'.&lt;/P&gt;&lt;P&gt;*Use can use the format depending on the length of your *pack field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you have more variable decimal length.&lt;/P&gt;&lt;P&gt;lint = lp2.&lt;/P&gt;&lt;P&gt;unpack lint to lchr.&lt;/P&gt;&lt;P&gt;shift lchr right by 3 places.&lt;/P&gt;&lt;P&gt;write : / lchr no-zero using edit mask 'RR____.__'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;DEL&gt;-Just wanted you to check that if you use the divide by 100000 you can get rounding issues&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 08:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-decimal-places/m-p/1504672#M233314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T08:07:52Z</dc:date>
    </item>
  </channel>
</rss>

