Round of decimal point

Hi,
        I have a data field with data element 13 digits integer and 3 decimal points. But I want to display it with only 2 decimal points. I don't want to change the data element.
Eg: input = 100.438
  required output = 100.44
if input = 100.434
required output = 100.43
Thanks in advance,
Vishnu Priya

hi,
Just use this FM. it will give corect output.
DATA:
   L_MENGE_P5(16) TYPE P DECIMALS 5,
   L_MENGE_P3(16) TYPE P DECIMALS 2,
   L_ANDEC     like T006-ANDEC value 2.
  L_MENGE_P5 = '56.4456'.
  CALL FUNCTION 'ROUND'
    EXPORTING
     DECIMALS            = L_ANDEC
      input              = L_MENGE_P5     "over here u need to pass other than char
     SIGN                = '+'
   IMPORTING
     OUTPUT              = L_MENGE_P3
   EXCEPTIONS
     INPUT_INVALID       = 1
     OVERFLOW            = 2
     TYPE_INVALID        = 3
     OTHERS              = 4
  IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
WRITE:/ L_MENGE_P3.
Regards
Anversha

Similar Messages

  • Rounding off decimal points

    hi,
    i have record with value 237.741343124473. when user enter 237.7413431244, the record should return. i am using round function but is not working the way i want. is there any other function which can be used to round of the decimal points

    How it is possible, because in my earlier reply i have added a same valued row in the test table and now when i am giving :
    SQL> SELECT * FROM TEST WHERE TRIM(to_char(TRUNC(A, 12),'999.999999999999'))='237.741343124473';
             A
    237.741343
    It is returning the row.  Now you question will be why it is not returning the whole value? so for that:
    SQL> SELECT to_char(a,'999.999999999999') FROM TEST WHERE TRIM(to_char(TRUNC(A, 12),'999.999999999999'))='237.741343124473';
    TO_CHAR(A,'999.99
    237.741343124473
    Means, you have to apply to_char function on the column.Play around to_char,trunc functions; you can get your desired output.
    Regards
    Girish Sharma

  • Rounding off during APP (f110) of decimal point

    Hi
    Can any one help me? When I run the T.Code f110 for automatic payment programme is generate cheque propaly, here my client want to rounding off for the decimal point in cheque amount as if coin adjastment.

    Hello Arup,
    I guess OB90 is helpful to you so pls check the same.
    Thanks & Regards,
    Lakshmi S

  • Rounding off to nearest decimal point

    i have these values
    35.2
    35.3
    35.4
    35.5
    35.7
    35.8
    35.9
    36.0
    i am looking for indexes closet 35.74 in my array. (which is index 4.)
    i used the "round to nearest" function and it gave me 36.
    which is index 7.
    what other ways to get the right index?
    Solved!
    Go to Solution.

    You will always have some difficulties with rounding to a specific number of digits after the decimal point because of the way numbers are represented in binary. When expressed in binary 0.1 is an infinitely repeating expression. Regardless of the display the internal representation of the number always uses the maximum resolution for the data type (8 bytes for DBL).
    So you need to be very careful to define exactly what you  want. If you have an array of values (regardless of the way they are displayed) Then you can find the closest to a Test Value by subtracting Test Value from the array and finding the minimum of the absolute values of the differences.
    Note that in the image below the same values are in Array and Array 2 with the display on Array 2 set for 20 siginficant digits. 
    Lynn

  • Convert the money datatype to a 2 decimal point format.

    Whats the best way to convert the money datatype to a 2 decimal point format in ms sql 2005 for use in my applications.
    this?
    CAST(tr.depositReceivedAmount AS decimal(10 , 2))

    I respectfully disagree with the notion that you should change the SQL column from a 'money' data-type to something else.
    In most database servers, 'money' is a data type that is designed to provide very consistent behavior with regard to arithmetic accuracy.  In Microsoft Access, the representation is a scaled-integer.  In MS SQL Server, it is obviously similar.  Ditto Oracle and all the others.
    You want the money data-type in the database to have this accuracy, because "hell hath no fury like an accountant in search of one lousy penny."   The database column storage-formats are designed to satisfy accountants, and that is a Good Thing.
    Meanwhile, you also want to take care as to exactly how you deal with the values.  There are several points where rounding could take place.  You do not have at your disposal the strongest possible handling of floating data-types in ColdFusion.  You are also somewhat at the mercy of whatever interface software may lie between you and whatever SQL server you may use.  "It's okay to round values once, but not multiple times."
    I suggest rounding the value right before display, and stipulating that the user's input must be two decimal places.
    Then, you might have to do some things at the SQL server's end.  For instance, when you update a value in the table, you may need to use server-side logic to explicitly truncate the value to two decimal-points, so that an update of "$34.56" explicitly updates the column to "$34.5600."  (This sort of thing has to happen within the SQL server context.)  You know that the user's input has exactly two significant digits, but maybe (maybe not...!) the SQL server might not know this.  You want to ensure that the server's internally-stored value represents exactly two significant digits, when the value originates from a user-input.
    Don't err on the side of "your convenience" or "what looks good on-screen."  (If you do, get ready to get phone-calls from the accountants, always at inopportune hours of the night.)

  • OBIEE 11.1.1.6 - Requirement is to show 3 digits after the decimal point.

    Hi,
    I have a requirement to concat 2 columns ( 1st column is a text column and 2nd column is a numeric column set as double in RPD). For the 2nd column, user wants to see 3 decimal digits all the time.
    For example, if the value is 2.4567 then I need to show round off value 2.457 and if the value if 3.4 , then I need to show 3.400 and if the value is 4 then I need add decimal point and show 4.000.
    Please let me know how I can achieve using OBIEE application without having to go through RPD.
    Thanks
    Swarna
    Edited by: 934460 on May 15, 2012 12:48 PM

    Try the following:
    In this example:
    Column 1: Month Name
    Column 2: Revenue
    Column 3: Month - Revenue
    Formula for Month - Revenue column will be:
    Month Name ||' - '|| cast(round(Revenue, 3) as char)Hope it helps.
    Regards,
    Kalyan Chukkapalli
    http://123obi.com

  • Change decimal points in SD Condition type from 2 to 3, for EU

    Hello,
    We have a slight problem with the amounts. We are using resource related billing in the project and to track some expenses, there are some condition types created. Since the currency is maintained as EU, the decimal places are maintained as 2 decimals in OY04 and we dont want to change that.
    We face an issue, when SAP Converts condition value from 3 to 2 decimals
    For example, when in Contract we have an Condition Value of 100.025, this is converted to 100.03 and tax is applied on this amount.
    When we create an invoice and subsequently a Credit Memo request, that will contain more than one item, and the sum of all items will have to sum up to 100.03, but this is never the case, as with the application of tax rate, the value comes to something like 100.02 or 100.04..
    With 3 decimal points, this amount adds upto correct value.
    So our ideal solution will be the have the Condition Values as 3 decimals and the Net value in 2 decimals.
    Is there something  that can be done for this?
    Hoping for a quick response.
    Regards
    Maddy

    SAP stores the 3 decimal value in XKOMV-kbetr and Xkomv-kwert is calculated based on this 3 decimal values...
    I had a similar scenario with currency conversion and rounding issue in sales Order and Invoice processing, in VOFM routines... so I used a Floating point  value and converted to character value and then used that 3 decimal value for calculation.

  • Problems with Illustrator CS6 not accepting stroke weights with decimal points

    So I have been using Illustrator for almost 10 years and have never run into this one. When enter a stroke weight on a line with a decimal point like .25 or 4.5 is keeps rounding the number up. For example I enter 0.75 and it makes it 1 point or I enter 5.5 and it makes it 6 point. Whether I enter the number manually or pick from the drop down (0.25, 0.5 or 0.75) it keeps rounding my strokes to even numbers. How did I do and how do I fix it?

    Thanks from me too! Was also very frustrated by this.

  • Answers Decimal Points

    When I'm in answers it is by default rounding all of my dollar amount columns to one decimal point.
    Ex: Amount = $17.55 (on the database) is rounding to $17.6 in my Answers result.
    I know that I have the ability to edit the format in Answers to override the result (specify two decimal points). However, i would like to set it up so that it is by default always producing two decimal points.
    Where would I set this up?
    Thanks...

    hi ,
    we can set the in administator tool or answers also
    administrator tool
    click the column properties
    use the round function in expression Biulder.
    apply the round function wit 2
    and go to presentation services
    and change data formates what we required

  • Increasing currency from 2 to 3 decimal points

    Dear all,
    I would like to know how to make the currency view in the expense report increased from 2 to 3 decimal points as km/miles rate we have here is $0.335  per mile.  Also the USD is used for 5 other countries.  As of now it is showing as 0.34, however this is a manipulation of actual data, Ex. for 10 kms it shows rate 0.34 x miles 10 = $3.35.
    Any quick response would be of great help.
    Regards,
    LN Bhattacharya

    Yes this is a known issue as the problem is, that the USD is a currency with 2 decimals, but government allowes to reimburse 0.375 USD taxfree. The output on the travel form is in a single currency: the USD with 2 decimals. One workaround is to create a currency USDN for the decimilisation to work with 3 places - see the note 446116
    A single expense category like miles per diems is calculated in accounting program RPRTEC00 and stored in one table (PAUFA for miles).
    If currency in T706F (USDN) differs from trip currency (USD), RPRTECC00 converts the amounts from T706F into trip currency (done by FI-function 'CONVERT_TO_LOCAL_CURRENCY'). Amounts in the list are presented in this trip currency but rounding is possible with adjustment in V_T001R as PREC can handle this conversion with factors defined here.
    Hope it helps!
    Thanks
    Sally

  • FM to get only quantity without its decimal points

    hi guys,
    is there any FM that can enable to get only qty without its decimal points without rounding up.
    e.g.: 500.12 , i need to get only 500 and exclude .12

    Hi Ester,
    U dont need any FM for that. You can use a simple logic like shown below:
    data: lv_quant  TYPE p DECIMALS 3 VALUE '500.96'.
    DATA: lv_out  type i.
    lv_out = trunc( lv_quant ).
    write lv_out. "this will have your result
    Regards,
    Prakash

  • Trim upto 2 decimal  points + js

    Hi,
    I want to trim a decimal number upto 2 decimal points.ie i
    want to show only 2 digits after the decimal point.How do i acheive
    this in Javascript. I do not want to use the Round function as it
    causes the value to change by 0.01.
    this is the code i've been using:-
    document.getElementsByName("totalincvat_value_nett")[0].value
    = parseFloat(totalincvat_value_nett).toFixed(2);
    Is there any way to show upto 2 decimal points and cut off
    the rest?
    thnx

    Hi,
    Have a try with this custom function (I found this in another
    forum)..
    function roundNumber(num, dec)
    var result =
    Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
    return result;
    }

  • Set No Decimal Point for Quantity in Any Stock Movement.

    Hi experts,
    Can anybody tell me how to block user from entering qty with decimal point in any stock movement that they plan to do. Our current system setting allowed user to do goods issue with decimal quantity such as 1.25 Unit.
    Regards.

    Hi Sujiana,
    If you dont want to decimals i think one option is availble is it correct or i dont know.why dont you try onece for this
    Go to logistics general ->Quantity optimizing and allowed logistics units of mesure->unit of measure rounding rule
    do here round to your unit
    i think it may be helpful to you
    Prem

  • Varchar to 2 decimal points ?!

    Hi,
    I have the below code; which I need to set the Line Total to 2 decimal points but it is a varchar since I want to attach the currency symbol to it:
    {CASE
                        WHEN T0.DocCur = 'EUR' THEN CONVERT (varchar(50), T0.DocCur) + ' ' + CONVERT (varchar(50), T1.LineTotal)
                        ELSE CONVERT (varchar(50), T0.DocCur) + ' ' + CONVERT (varchar(50), T1.TotalFrgn)
              END as 'Line Total'}
    Appreciate your help.
    Thanks

    First round your line total and other numeric fields and then do your convert.
    CONVERT (varchar(50), ROUND(T1.LineTotal, 2))

  • Working With Prices/Decimal Points

    I've recently figured out how to perform calculations on values by assigning them to variables in a click function however I'm working with prices in my app and it seems difficult to get prices/decimal points to claculate properly. At the moment my app looks like this:-
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
    <![CDATA[
    private function getTotal():void{
    var addon1Int:int = parseInt(addon1.text);
    var addon1Float:Number = parseFloat(addon1.text);
    var addon1Number:Number = new Number(addon1.text);
    var addon2Int:int = parseInt(addon2.text);
    var addon2Float:Number = parseFloat(addon2.text);
    var addon2Number:Number = new Number(addon2.text);
    var addon3Int:int = parseInt(addon3.text);
    var addon3Float:Number = parseFloat(addon3.text);
    var addon3Number:Number = new Number(addon3.text);
    var addon4Int:int = parseInt(addon4.text);
    var addon4Float:Number = parseFloat(addon4.text);
    var addon4Number:Number = new Number(addon4.text);
    var addon5Int:int = parseInt(addon5.text);
    var addon5Float:Number = parseFloat(addon5.text);
    var addon5Number:Number = new Number(addon5.text);
    var quantityNumber:Number = new Number(quantity.value);
    total.data = (addon1Number + addon2Number + addon3Number + addon4Number + addon5Number) * (quantityNumber);
    ]]>
    </mx:Script>
    <mx:Text id="addon1" text="5.99"/>
    <mx:Text id="addon2" text="6.99"/>
    <mx:Text id="addon3" text="8.99"/>
    <mx:Text id="addon4" text="4.99"/>
    <mx:Text id="addon5" text="3.99"/>
    <mx:NumericStepper id="quantity"/>
    <mx:Button label="Button" click="getTotal();"/>
    <mx:Text id="total"/>
    </mx:Application>
    It works ok if the numbers in the text areas are whole numbers like 8 or 4 but if I use numbers like 02.99, 05.09 the result comes out a bit srange. For example the result of the numbers that I have in there now if I set the value to 2 in the numeric stepper is 61.900000000000006 when I know from using a real calculator it should be 61.9. Is there any way perhaps of rounding this code to the nearest decimal point so it appears as 61.90?
    Are there any good tutorials that any of you know of when working with prices/decimal points in flex?

    I've managed to find the solution for this - the currency formatter. If anyone's interested or has similar problems her's the code that solves it for me:-
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.formatters.NumberBaseRoundType;
    private function getTotal():void{
    var addon1Int:int = parseInt(addon1.text);
    var addon1Float:Number = parseFloat(addon1.text);
    var addon1Number:Number = new Number(addon1.text);
    var addon2Int:int = parseInt(addon2.text);
    var addon2Float:Number = parseFloat(addon2.text);
    var addon2Number:Number = new Number(addon2.text);
    var addon3Int:int = parseInt(addon3.text);
    var addon3Float:Number = parseFloat(addon3.text);
    var addon3Number:Number = new Number(addon3.text);
    var addon4Int:int = parseInt(addon4.text);
    var addon4Float:Number = parseFloat(addon4.text);
    var addon4Number:Number = new Number(addon4.text);
    var addon5Int:int = parseInt(addon5.text);
    var addon5Float:Number = parseFloat(addon5.text);
    var addon5Number:Number = new Number(addon5.text);
    var quantityNumber:Number = new Number(quantity.value);
    var total:Number = (addon1Number + addon2Number + addon3Number + addon4Number + addon5Number) * (quantityNumber);
    totalAmount.text=currencyFormatter.format(total);
    ]]>
    </mx:Script>
    <mx:CurrencyFormatter id="currencyFormatter" precision="2" rounding="none" decimalSeparatorTo="." thousandsSeparatorTo="," useThousandsSeparator="true" useNegativeSign="true" currencySymbol="£" alignSymbol="left"/>
    <mx:TextInput id="addon1" text="5.99"/>
    <mx:TextInput id="addon2" text="06.99"/>
    <mx:TextInput id="addon3" text="08.99"/>
    <mx:TextInput id="addon4" text="04.99"/>
    <mx:TextInput id="addon5" text="03.99"/>
    <mx:NumericStepper id="quantity"/>
    <mx:Button label="Button" click="getTotal();"/>
    <mx:Text id="totalAmount"/>
    </mx:Application>

Maybe you are looking for

  • Apps exist but can only find them thru Search

    I have an iPhone 4S with nearly 400 apps on it.  Until recently, those apps were arranged in 11 neat pages of icons and folders.  Then this happened: 1.  I updated to IOS 6.  All seemed well. 2.  Tired of opening folders for some apps, I decided to m

  • How to get DATETIME value in a page?

    Hi, I have two pages. In page1, I have a table that contain MessageStyleText item(AuditTime) and the attribute data type is DATETIME . I want to pass AuditTime value from page1 to page2. I am passing the AuditTime value from page1 to page2 using Dest

  • BEx Query Designer Jump Query Error

    Creating a jump query from BW (nw2004s) to R3 (6.20). Services in SICF activated webgui, system and shuffler all published to internal. Table TWPURLSVR maintained on the R3 side. The query logs into the portal, but upon attempting to do a dispaly w/i

  • Got screen like when Touch is brand new...

    when I turned it on. Hooking it up to iTunes got the home screen to appear, so thankfully I didn't need to restore the entire Touch. Is there any other method to get the Touch working if I'm not near my PC? I tried to hold both buttons for 5+ seconds

  • FM SAP_CONVERT_TO_CSV_FORMAT - separator is wrong.

    I am using FM SAP_CONVERT_TO_CSV_FORMAT and I have the field separator as a comma but when the file is exported it has the separator as a semicolon.  Does anybody have any ideas why this is happening?  Below is my code and a portion of the exported d