<?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 Rounding problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056067#M1353219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the result is 98,067 and I want to show 98,07 but if the result 98,064 I want to show 98,06 simple rules of rounding !!, but How can I do that within the program? . Is there a easy way to do that?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have fixed point arithmetic uncheked for this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_kwert2 TYPE p DECIMALS 3,&lt;/P&gt;&lt;P&gt;      gv_kwert2 LIKE konv-kwert,&lt;/P&gt;&lt;P&gt;      tvbdpr-fkimg LIKE VBDPR-fkimg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_kwert2 = ( gv_kwert2 * 10000 ) / tvbdpr-fkimg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Debugging the program you get the following values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_kwert2 =            0.000&lt;/P&gt;&lt;P&gt;gv_kwert2 =         294.20&lt;/P&gt;&lt;P&gt;tvbdpr-fkimg =       3.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After executing the calculation value for lv_kwert2 is  98.067. I need to round this value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea would be very much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks all in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Aug 2009 18:55:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-31T18:55:49Z</dc:date>
    <item>
      <title>Rounding problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056067#M1353219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the result is 98,067 and I want to show 98,07 but if the result 98,064 I want to show 98,06 simple rules of rounding !!, but How can I do that within the program? . Is there a easy way to do that?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have fixed point arithmetic uncheked for this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_kwert2 TYPE p DECIMALS 3,&lt;/P&gt;&lt;P&gt;      gv_kwert2 LIKE konv-kwert,&lt;/P&gt;&lt;P&gt;      tvbdpr-fkimg LIKE VBDPR-fkimg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_kwert2 = ( gv_kwert2 * 10000 ) / tvbdpr-fkimg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Debugging the program you get the following values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_kwert2 =            0.000&lt;/P&gt;&lt;P&gt;gv_kwert2 =         294.20&lt;/P&gt;&lt;P&gt;tvbdpr-fkimg =       3.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After executing the calculation value for lv_kwert2 is  98.067. I need to round this value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea would be very much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks all in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056067#M1353219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056068#M1353220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just use keywords like CEIL,FLOOR,TRUNC,with the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;n = func( m ).&lt;/P&gt;&lt;P&gt;check out this link&lt;/P&gt;&lt;P&gt;[Mathematical functions|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3316358411d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and with write statement you can use ROUND&amp;lt;n&amp;gt;&lt;/P&gt;&lt;P&gt;check this&lt;/P&gt;&lt;P&gt;[Formatting Options|http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 19:07:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056068#M1353220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T19:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056069#M1353221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Use the FM ROUND...and choose to have 1 decimal points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 19:33:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056069#M1353221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-31T19:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056070#M1353222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when "fixed point arithmetic" flag is unchecked, operations on packed numbers are done &lt;STRONG&gt;as if they had no decimals at all&lt;/STRONG&gt;. In your case, to round, you just have to divide by 10 (the least significant digit is cut with a commercial rounding on the previous digit), and multiply by 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;lv_kwert2 = ( gv_kwert2 * 10000 ) / tvbdpr-fkimg / 10 * 10.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(yes I know, it's very difficult to understand, but logic with my initial explanation)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But using ROUND FM which works with "fixed point arithmetic", it's much more easier (though slower). Note that this FM has documentation. Use parameter SIGN='X' to get a commercial rounding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 22:20:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-problem/m-p/6056070#M1353222</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-08-31T22:20:21Z</dc:date>
    </item>
  </channel>
</rss>

