<?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 down values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318147#M508622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the sample code  with  function modele  for  1 decimal  ...just   increase   decimal  places in the function modules  input  ...so  that  your  decinal values  will be as you want  ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: dec2 TYPE p DECIMALS 2 VALUE '22.234',
      dec1 TYPE p DECIMALS 1,
      ld_str(50) TYPE c.


CALL FUNCTION 'ROUND'
  EXPORTING
    decimals      = 1
    input         = dec2
    sign          = '-'  "Negative Rounding Concept
  IMPORTING
    output        = dec1 "result will be 22.2
  EXCEPTIONS
    input_invalid = 1
    overflow      = 2
    type_invalid  = 3
    OTHERS        = 4.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points  if it is usefull ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2007 04:45:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-19T04:45:04Z</dc:date>
    <item>
      <title>Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318141#M508616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need to round down values for ex.&lt;/P&gt;&lt;P&gt;22321.428571.  Therefore, we would want this figure displayed as:  22321.42 not 22321.43.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2007 07:03:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318141#M508616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-16T07:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318142#M508617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you can also do is split the amount on '.', get the second part in lenght 2 and concatenate again them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2007 07:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318142#M508617</guid>
      <dc:creator>Peter_Inotai</dc:creator>
      <dc:date>2007-05-16T07:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318143#M508618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Assign the value to a variable defined as Type p decimal 1&lt;/P&gt;&lt;P&gt; and move the value to variable Type p decimal 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2007 07:15:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318143#M508618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-16T07:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318144#M508619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dec2 TYPE p DECIMALS 2 VALUE '22.23',&lt;/P&gt;&lt;P&gt;      dec1 TYPE p DECIMALS 1,&lt;/P&gt;&lt;P&gt;      ld_str(50) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ld_str = dec2.&lt;/P&gt;&lt;P&gt;SHIFT ld_str RIGHT DELETING TRAILING ' '.&lt;/P&gt;&lt;P&gt;SHIFT ld_str RIGHT BY 1 PLACES.&lt;/P&gt;&lt;P&gt;SHIFT ld_str LEFT DELETING LEADING ' '.&lt;/P&gt;&lt;P&gt;dec1 = ld_str.  "result will be 22.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------" /&gt;&lt;P&gt;reward points if answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2007 08:13:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318144#M508619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-16T08:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318145#M508620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRUNC(a,n) is an arithmetic function with the following result (for the values a and n):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRUNC(a) &amp;#150; truncate the decimal places of a&lt;/P&gt;&lt;P&gt;TRUNC(a,n) &amp;#150; truncate the number a after n decimal places &lt;/P&gt;&lt;P&gt;TRUNC(a,-n) &amp;#150; set n places in the number a before the decimal point to 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a Good day!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318145#M508620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T04:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318146#M508621</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;Try to use the ROUND function module by passing '-' in sign parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:42:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318146#M508621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T04:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318147#M508622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the sample code  with  function modele  for  1 decimal  ...just   increase   decimal  places in the function modules  input  ...so  that  your  decinal values  will be as you want  ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: dec2 TYPE p DECIMALS 2 VALUE '22.234',
      dec1 TYPE p DECIMALS 1,
      ld_str(50) TYPE c.


CALL FUNCTION 'ROUND'
  EXPORTING
    decimals      = 1
    input         = dec2
    sign          = '-'  "Negative Rounding Concept
  IMPORTING
    output        = dec1 "result will be 22.2
  EXCEPTIONS
    input_invalid = 1
    overflow      = 2
    type_invalid  = 3
    OTHERS        = 4.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points  if it is usefull ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318147#M508622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T04:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding down values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318148#M508623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  .... here is the code for  Rouding down without   Rounding to  nearest value...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*Rounds a value DOWN to 1 decimal using char manipulation
DATA: dec2 TYPE p DECIMALS 2 VALUE '22.25',
      dec1 TYPE p DECIMALS 1,
      ld_str(50) TYPE c.

ld_str = dec2.
SHIFT ld_str RIGHT DELETING TRAILING ' '.
SHIFT ld_str RIGHT BY 1 PLACES.
SHIFT ld_str LEFT DELETING LEADING ' '.
dec1 = ld_str.  "result will be 22.2

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points  if it is usefull ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 04:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rounding-down-values/m-p/2318148#M508623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T04:46:35Z</dc:date>
    </item>
  </channel>
</rss>

