<?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: dividing 1/3 problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840404#M1957352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really an ABAP problem! The solution is very simple. After the calculations are done, you must calculate the sum of all division results (0.99) and subtract it from the initial total (1.00). You'll get 0.01, you just add it to the last "bucket" so that now the sum of all divisions corresponds to the initial total.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2016 16:52:50 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2016-08-17T16:52:50Z</dc:date>
    <item>
      <title>dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840403#M1957351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've got a problem with dividing, I need to divide 1 USD per 3 people. Each of them will receive 0.33USD, but I want to split whole amount, to add extra 0,01USD to someone, or take this one cent if I want to split 2USD per 3 people.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I split some amount into almost equal parts?&lt;/P&gt;&lt;P&gt;I guess, that pricing can do it (I saw once 0,33 0,33 0,34), but I don't know how to put there a fraction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 14:52:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840403#M1957351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-17T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840404#M1957352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really an ABAP problem! The solution is very simple. After the calculations are done, you must calculate the sum of all division results (0.99) and subtract it from the initial total (1.00). You'll get 0.01, you just add it to the last "bucket" so that now the sum of all divisions corresponds to the initial total.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 16:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840404#M1957352</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-17T16:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840405#M1957353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in good, old ABAP4, something like this will do the trick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;REPORT&lt;/SPAN&gt; zfc_test&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;PARAMETERS&lt;/SPAN&gt;: p_amount&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; p &lt;SPAN style="color: #0000ff;"&gt;DECIMALS&lt;/SPAN&gt; 2&lt;SPAN style="color: #800080;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_people&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; n&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt;: l_value &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; p &lt;SPAN style="color: #0000ff;"&gt;DECIMALS&lt;/SPAN&gt; 2&lt;SPAN style="color: #800080;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_remainder &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; p &lt;SPAN style="color: #0000ff;"&gt;DECIMALS&lt;/SPAN&gt; &lt;SPAN style="color: #3399ff;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;START-OF-SELECTION&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; l_value&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;p_amount / p_people&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; l_remainder&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;p_amount - &lt;SPAN style="color: #800097;"&gt;(&lt;/SPAN&gt; l_value * p_people &lt;SPAN style="color: #800097;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DO&lt;/SPAN&gt; p_people &lt;SPAN style="color: #0000ff;"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IF&lt;/SPAN&gt; sy-index&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;p_people&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_value&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;l_value + l_remainder&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;WRITE&lt;/SPAN&gt;: / l_value&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_emote jive_macro" src="https://community.sap.com/111/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the result with 1 USD, 3 people:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1017625" /&gt;&lt;/P&gt;&lt;P&gt;here for 2 USD, 3 people:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1017624" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flavio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 19:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840405#M1957353</guid>
      <dc:creator>Flavio</dc:creator>
      <dc:date>2016-08-17T19:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840406#M1957354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, of course this is not even tricky to develop, but what if I have 12 to divide by 7 people? There should be each 1.71, 0.03 missing. I want to split 0,03, not to add to some person. It's a little bit harder, but still possible to write in basic code, but that's not the point. I'm looking for some standard functionality, which do the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 21:53:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840406#M1957354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-17T21:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840407#M1957355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 23:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840407#M1957355</guid>
      <dc:creator>former_member225253</dc:creator>
      <dc:date>2016-08-17T23:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840408#M1957356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Highly commendable. If you find some standard functionality, please post it. I've never found any!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 06:06:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840408#M1957356</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-08-18T06:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: dividing 1/3 problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840409#M1957357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This method will give all the remainder to last person, I prefer to share it more ethically?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;PARAMETERS&lt;/SPAN&gt;: amount &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; p &lt;SPAN style="color: #0000ff;"&gt;DECIMALS&lt;/SPAN&gt; 2&lt;SPAN style="color: #800080;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; people &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; i&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&lt;SPAN style="color: #0000ff;"&gt;START-OF-SELECTION&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA&lt;/SPAN&gt;: share &lt;SPAN style="color: #0000ff;"&gt;TYPE&lt;/SPAN&gt; p &lt;SPAN style="color: #0000ff;"&gt;DECIMALS&lt;/SPAN&gt; &lt;SPAN style="color: #3399ff;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DO&lt;/SPAN&gt; people &lt;SPAN style="color: #0000ff;"&gt;TIMES&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; share&lt;SPAN style="color: #800080;"&gt; = &lt;/SPAN&gt;amount / people&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;WRITE&lt;/SPAN&gt;: / share&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;SUBTRACT&lt;/SPAN&gt; share &lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; amount&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;SUBTRACT&lt;/SPAN&gt; &lt;SPAN style="color: #3399ff;"&gt;1&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;FROM&lt;/SPAN&gt; people&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-family: courier; color: black;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDDO&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So for 3 or 7people &lt;/P&gt;&lt;P&gt;0,33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,14&lt;/P&gt;&lt;P&gt;0,34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,14&lt;/P&gt;&lt;P&gt;0,33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,14&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,14&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 06:23:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dividing-1-3-problem/m-p/11840409#M1957357</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2016-08-18T06:23:03Z</dc:date>
    </item>
  </channel>
</rss>

