<?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: Rounding  a float value. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244842#M774463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot get 1.67 from 1.6666666666666666E-01 because it is nothing but the value 1.6666666666666666 raised to the power of -1 which is 0.16666666666666 to whatever precision which when rounded will become 0.17 (just what you got using a packed decimal). There is nothing wrong in what you are getting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2008 21:16:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-07T21:16:52Z</dc:date>
    <item>
      <title>Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244841#M774462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to round a float value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose the value is 1.6666666666666666E-01 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need the output as 1.67&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hve been using ROUND function module but it gives me 1.6700000000E-01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I use Packed decimal it takes as 0.17&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chaithanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 21:12:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244841#M774462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-07T21:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244842#M774463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot get 1.67 from 1.6666666666666666E-01 because it is nothing but the value 1.6666666666666666 raised to the power of -1 which is 0.16666666666666 to whatever precision which when rounded will become 0.17 (just what you got using a packed decimal). There is nothing wrong in what you are getting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 21:16:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244842#M774463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-07T21:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244843#M774464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Multiple by 10?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  rich_0001.

data: f type f value '1.6666666666666666E-01'.
data: p type p decimals 2.

p = f * 10.

write:/ p.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 21:18:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244843#M774464</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-07T21:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244844#M774465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Rich. Thanks for the solution. It got solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are becoming richer by getting more points....&lt;/P&gt;&lt;P&gt;Just kidding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;chaithanya K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 21:34:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244844#M774465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-07T21:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244845#M774466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this is the best way to do this, not sure that it will always work for all values, but in this particular case it does, hence the reason for my "?" in my above response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, the points make me richer, which means more food for the hungry.  &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/mark.finnern/blog/2007/11/28/food-for-points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2008 21:43:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244845#M774466</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-01-07T21:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244846#M774467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you just multiply any value to get the your answer? How is that correct? I think you are doing the wrong thing to assume that you should multiply by 10. Are you working in one of those user exits where the "fixed point arithmetic" attribute is not checked?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2008 18:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244846#M774467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-08T18:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding  a float value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244847#M774468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Now this thread has become a Knowledge Sharing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As Rich already mentioned it is not the best solution but for me it worked out.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not working in any User exits. I had a floating point value when printed using forms it took large value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.6666666666&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I needed to truncate it or round it up to 3 decimals. Hope you understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chaithanya K&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: chaithanya k on Jan 9, 2008 7:57 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2008 02:26:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-a-float-value/m-p/3244847#M774468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-09T02:26:04Z</dc:date>
    </item>
  </channel>
</rss>

