Rounding UP Currency figures?

Hello!!!
I have the following piece of code:
SELECT
LPA_HISTORY.CLAIM_NO,
SUM ((LPA_HISTORY.END_DATE - LPA_HISTORY.START_DATE +1 ) * (LPA_HISTORY.LPA_AMT /7))
FROM LPA_HISTORY
GROUP BY LPA_HISTORY.CLAIM_NO
I use this in Oracle reports and use the format mask $NNN,NN0.00 to round up the final figure.
But the final figure always seems to be a few pence out, i think i need to be rounding up the *(LPA_HISTORY.LPA_AMT /7)* before i multiply it!!!
How would i do this??
Thanks :)

Not sure rounding up will solve your calculation inaccuracies, but anyway...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select rownum/10 as rn from dual connect by rownum <= 25)
  2  -- end of test data
  3  select rn, trunc(rn+0.5) as rnd_up
  4* from t
SQL> /
        RN     RND_UP
        .1          0
        .2          0
        .3          0
        .4          0
        .5          1
        .6          1
        .7          1
        .8          1
        .9          1
         1          1
       1.1          1
       1.2          1
       1.3          1
       1.4          1
       1.5          2
       1.6          2
       1.7          2
       1.8          2
       1.9          2
         2          2
       2.1          2
       2.2          2
       2.3          2
       2.4          2
       2.5          3
25 rows selected.
{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Rounding by currency

    Dear Experts,
        My B1 is 2007B PL08.
        Document setting is  Rounding by currency.
        My local currency is NTD. Amount decimal is 0, price is 2.
        My  FC is USD, I would like the  price decimal  is 3, and amount is 2.
        I know the system define just have a decimal column for price and amount(or total) with FC setting.
        How to overcome the problem.
    Glen

    Dear Glen,
    As you stated, the system controls all prices and values with 1 configuration system. To workaround and have a solution for your problem, I recommend setting your system's decimal point to 3. Then in the relevant Marketing document printout, round the figures to what you or your customer wish to express.
    Hope it helps!
    Warmest Regards,
    Chinho

  • Currency figure with 5 decimals

    is it possible to load (from a flat file) currency figures with 5 decimal places?  The figures come in various currencies and so need to be a CURR but for me it seems that all I can see is 2 decimals.
    Is there a way to do this?

    Will,
    There are two options:
    Option 1>Select Data-Type as FLTP rather than CURR on Type/unit tab of Key Figure creation.
    This can only be set when you create a key-figure, you can't change it afterwards
    Or
    Option 2 >
    Remdelling in BI7.0:
    you can explore is through remodelling.
    create a new key-figure and write a remodelling rule for replacing your old key-figure with new keyfigure.
    You will have to manage the behaviour of how the data gets copied from old to new key-figure in customer exit.

  • Round up a figure like 26.54

    Can any one tell Function module to round up a figure.

    Hi,
    Here is the answer
    DATA: X TYPE P DECIMALS 2 VALUE '12493.97'.
    WRITE: /X ROUND -2,      "output: 1,249,397.00
           /X ROUND  0,            "output:    12,493,97
           /X ROUND  2,             "output:       124.94
           /X ROUND  5,              "output:         0.12
    Regards
    Sudheer

  • Retrieve hard currency figures from SKC1A

    Hi,
    I have an issue that has been bothering me for a while. I need to be able to get hard currency figures from SKC1A. I am using logical database SDF, with no variant of the selection screen. For functionality reasons, I have added the currency key field (CURTP) as a SELECT-OPTION to the selection screen. To get data from SKC1A I use
    Get skc1a.
    CHECK SELECT-OPTIONS.
    In addition to this, I am trying to manipulate the SD_CURTP parameter that seems to control the currency key selection like this:
    SD_CURTP = s_curtp. " s_curtp is the SELECT-OPTION value.
    So my code looks like this:
    SD_CURTP = s_curtp. " s_curtp is the SELECT-OPTION value.
    Get skc1a.
    CHECK SELECT-OPTIONS.
    I have successfully managed to do the same manipulation with SD_STIDA previously (however, not in this program), so I do not understand why it should not work in the same way with SD_CURTP.
    However, this seems to have no effect on the currency type that is returned from SKC1A. When I select local currency in the selection field (in our config that value is '10'), I get the correct figures, but when I select hard currency (40), I get only 0's. It seems to be that no records are returned from get Get statement into my internal table storing the result.
    Does anyone have any bright ideas on how to get the hard currency figures from SKC1A?
    Help is greatly appreciated!
    Regards,
    Thomas
    Message was edited by: Thomas Kjelsrud
    Message was edited by: Thomas Kjelsrud

    Hi Andreas.
    You mean like this?
    CALL FUNCTION 'READ_SKC1C'
      EXPORTING
        xbukrs               = SD_BUKRS[]
        xgjahr               = sd_gjahr
       xgsber               =
        xrtcur               = s_curtp-low
        xsaknr               = SD_SAKNR[]
    IMPORTING
       XSKC1C               = i_incoming "internal table to store result
    EXCEPTIONS
       KEY_INCOMPLETE       = 1
       NOT_AUTHORIZED       = 2
       NOT_FOUND            = 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.

  • Rounding - for Key figures

    Hi All,
    I have a requirement in BEx .
    lets say i have keyfigure A1 having value , A1 - 345.5678. if i will do the rounding for two decimals then the ideal result will be A1 - 345.57.
    but, i want to keep the value for A1 - 345.56 after rounding also.
    Please suggest.
    Regards,
    Macwan James.

    Hi,
    Actually the number of the decimal places to which rounding should
    be performed for keyfigures are defined in table T006-ANDEC.
    Please refer to the following notes and carry out the manual steps which will solve the rounding issue.
    442987 - Decimal places/rounding units of measure
    866505 - Unwanted rounding of units T006-ANDEC
    Please also check the following SDN link.
    No Rounding of Key Figure
    Regards,
    Amit

  • Rounding up currency

    Hi all,
    I am new to java and I was writing my assignment. i hope somebody can help me. I am writing a program which basically calculate what change of dollars you should give to someone. The program works fine when I put figure in integer. but when i put cents in the amount it doesnt work . I know where is the problem. actually I am trying to do this:
    100.10%2
    This returns .099999998 something. I dont know why its not returning .10. I even tried with 2.0 but still the same. Can anyone tell me how I can round it up to .10 or whats wrong here happening.
    Thanx in advance.
    Gurdish Singh

    Regardless of language computers can only distinguish between a finite number of different floating point values. And as a result floating point types, as commonly implemented, only have a certain amount of precision. This makes them a different sort of beast from the mathematician's (infinitly precise) numbers. Both the mathematician and the computer attempt to model actual real world quantities, but they do so in subtly different ways.
    En wrote:
    Others will likely post you links that you should read to better understand this.Here's a couple:
    * David Golberg's [What Every Computer Scientist Should Know About Floating-Point Arithmetic|http://docs.sun.com/source/806-3568/ncg_goldberg.html]
    * An old Bill Venners [JavaWorld article|http://www.javaworld.com/javaworld/jw-10-1996/jw-10-hood.html]
    En wrote:
    For most this is more a problem of display rather than accuracy.I think that is the case here.
    OP wrote:
    actually I am trying to do this:
    100.10%2Are you happy with the % operator? It returns the remainder after dividing 100.10 as many times as possible by 2.
    OP wrote:
    This returns .099999998 something.What it really returns is "the remainder after dividing 100.10 as many times as possible by 2". (As accurately as inherently imprecise fp numbers can.)
    If you want to want to do further arithmetic with this number the best thing to do is ... nothing at all. It is already as accurate as it's ever going to get. And any rounding or other fiddling about with its value can only make it less accurate.
    If you want to display this value to a user, they won't appreciate seeing a string like ".099999998". So we format the string they see. From the mathematician's point of view "the remainder after dividing 100.10 as many times as possible by 2" represents one number and ".099999998" represents another. So some rounding will have taken place. But from the computer's point of view it's not rounding, but formatting: displaying a given fp number in a way the user will find palatable.
    (And if you want to do both, you can. Format the number for the user, but retain its value unchanged for further arithmetical work.)
    [String.format()|http://java.sun.com/javase/6/docs/api/java/lang/String.html#format(java.lang.String, java.lang.Object...)] is a very easy way to do this. Or its cousin, the PrintStream (etc) method [printf()|http://java.sun.com/javase/6/docs/api/java/io/PrintStream.html#printf(java.lang.String, java.lang.Object...)]. At some point you will have to have a look at the Formatter documentation for details: especially the secions on "Format string syntax" and "Conversions".
    Edited by: pbrockway2 on Aug 18, 2008 12:00 PM
    I've just read that it's a money problem...
    One way to sidestep the imprecise->inaccurate problem is not to use floating point types. If you store and manipulate the money values as cents (pennies etc) you could do so with int (or long). The finite nature of computers shows up here in the the finite range of these types, but not with imprecision. 10010 cents is quite precise: it's not 10009 nor 10011. And 10010%2 will give just the value you expect. (Some formatting still required though since you will have to put a dot in the displayed string.)

  • Rounding off currency value

    Hi all,
           Is there a function module to round off the currency value to nearest 0.05 , ie. if the currency value is 10.63, it should be rounded off to 10.65 and when it is 10.68, it should be rounded off to 10.70?
          If yes, could you please let me know?
          Any help in this regard is appreciated.
    Regards,
    Partha.

    hi,
    try this out.here is the sample program.
    pl look into my modified program,
    i am assuming your requirement is like
    if the last digit in your value is < 5. it should be rounded to 5.
      like 10.23 should come to 10.25
    & if the last character value is > 5 , it should be rounded to next value with 0.
        10.67 should be 10.70
        10.98 should be 11.00.
    with this assumption, i developed this small code. let me know, if i am wrong.
    regards
    srikanth
    DATA : V_CURR TYPE VBAK-NETWR,
           V_CHAR(10) TYPE C.
    V_CURR = '10.67'.
    WRITE  V_CURR TO V_CHAR.
    CONDENSE V_CHAR NO-GAPS.
    DATA : V_STRLEN TYPE I.
    BREAK-POINT.
    V_STRLEN = STRLEN( V_CHAR ).
    IF V_STRLEN <> 0 .
      V_STRLEN = V_STRLEN - 1.
      IF V_CHAR+V_STRLEN < '5'.
        V_CHAR+V_STRLEN = '5'.
        V_CURR = V_CHAR.
      ELSE.
        IF V_CHAR+V_STRLEN = '6'.
          V_CURR = V_CURR + '0.04'.
        ELSEIF V_CHAR+V_STRLEN = '7'.
          V_CURR = V_CURR + '0.03'.
        ELSEIF V_CHAR+V_STRLEN = '8'.
          V_CURR = V_CURR + '0.02'.
        ELSEIF V_CHAR+V_STRLEN = '9'.
          V_CURR = V_CURR + '0.01'.
        ENDIF.
      ENDIF.
    ENDIF.
    write :/ v_curr,
             v_char.
    added modified code.
    Message was edited by: Srikanth Kidambi

  • Rounding-off Currency fields.

    Hi,
    Can someone tell me how to round-off value of currency field.
    If fraction <= 0.49 it should be rounded-off to 0.00
    If fraction >= 0.50 it should be rounded-off to 1.00

    Hi, you have the Function Module ROUND too,
    here a litle example ( the paremeter sign = 'X' set how the number will be rounded )
    DATA l_input TYPE p DECIMALS 5.
    break-point.
    l_input = '0.499'.
    CALL FUNCTION 'ROUND'
      EXPORTING
        decimals      = 0
        input         = l_input
        sign          = 'X'
      IMPORTING
        output        = l_input
      EXCEPTIONS
        input_invalid = 1
        overflow      = 2
        type_invalid  = 3
        OTHERS        = 4.
    l_input = '0.500'.
    CALL FUNCTION 'ROUND'
      EXPORTING
        decimals      = 0
        input         = l_input
        sign          = 'X'
      IMPORTING
        output        = l_input
      EXCEPTIONS
        input_invalid = 1
        overflow      = 2
        type_invalid  = 3
        OTHERS        = 4.
    Saludos
    Daniel

  • Rounding off Currency field

    Hi,
    I have to round off a currency field. Can some one provide the syntax for this.
    I have tried: WRITE lv1 ROUND 2.
    But I dont want to display it in output, I have to put round off value into another field.
    Regards,
    Pankaj.

    Hi,
    Check the below code
    PARAMETER : p_cur TYPE wrbtr.
    DATA : w_currency(10) TYPE c.
    WRITE p_cur ROUND 2 TO w_currency.
    w_currency = w_currency * 100.
    WRITE / w_currency.
    W_currency will have the round off value....

  • Rounding a currency field

    Hi experts,
    data: field1 type [currency field of size 15, decimals 2].
    field1 = 25.87.
    I want the value of field1 to be always rounded to 25.
    Please suggest a way.
    Pts will be rewaurded.

    Hi,
    Use ceil( ) function.
    Ex. a = ceil ( 398.98).
    wreite:/ a.
    or
    Call 'ROUND' Method as below
    DATA: WA_INPUT TYPE P DECIMALS 8,
    WA_OUTPUT TYPE P DECIMALS 2.
    WA_INPUT = '123.6581'.
    CALL FUNCTION 'ROUND'
    EXPORTING
    INPUT = WA_INPUT
    IMPORTING
    OUTPUT = WA_OUTPUT
    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: WA_OUTPUT.
    Hope it helps you.

  • Rounding up currency -  $2.9309 - $2.94???

    Having trouble rounding up dollar amount.
    Where do i look?
    Is it possible within the formula?
    Thanks
    Chad

    Numbers has a round() function.
    =round(A1, 2) will round the value to two places.  The result will appear in the cell where you enter this formula.
    if there is already some formula in cell A1, then you can place that formula in the round function.
    let say A1 contains the formula:
    =B1-B4
    you could use this formula to round to two places:
    =round(B1-B4, 2)

  • Rounding off currency

    Dear Gurus,
    Can some one tell me how the rounding for works.
    Financial Accounting ->AR/AP->Business Transaction->Outgoing Payments->Define Account for Rounding off difference.
    My client require the following scenario.
    a. Client wanted to book all the invoies with decimals at liability booking(FB60).
    Eg : 110.36 and 110.56
    b. While making payment(F-53 or F-58) he waanted to round off the decimals(as he do not want to cut the cheque for decimals
    Eg : 110 and 111
    Please help me to configure to get the out put
    Thanks
    Raju.

    Hi
    Have tolerances set up for the user as well as customer/vendor. This will automatically knock off the differences and you can pay in round amount
    S Jayaram

  • Inconsistent Rounding of Currency Attributes in Screen Labels in 10.2

    Hi all,
    I'm seeing some interesting rounding behaviour on screen labels in v10.2:
    Value -> Displayed
    $100.505 -> $100.50 [Incorrect]
    $100.515 -> $100.52 [Correct]
    $100.525 -> $100.52 [Incorrect]
    $100.535 -> $100.54 [Correct]
    $100.545 -> $100.54 [Incorrect]
    $100.545001 -> $100.55 [Correct]
    ... and so on. There is an easy workaround (the Round function) but I'm curious to know of there is an OPA lesson I'm missing here. Thoughts?
    Thanks,
    - Patrick

    Keep in mind that if 100.505 is being entered by a user into a Number field, it is only represented as an approximation of that value in binary form. What you're probably seeing is that the actual binary representation is equivalent to 100.5049999 - which when rounded gets converted to 100.50.
    OPA takes care of this for you when doing comparisons (e.g. a rule that says the value >= 100.505 will work, even if the value = 100.505). But when rounding an existing value for display, OPA can't help with that.

  • Allow Override of Rounding when 'By Currency' is true

    In PL 46 the standard feature which allows the user to override the rounding calculation now fails. In an AP Invoice, the override is checked, the amound is modified to the correct amount, as per the legal tax invoice provided by the supplier, and as soon as you leave the field, SAP replaces the calculated amount into the field.
    Legally, in Australia, a retail invoice for Point of Sale, needs to be rounded to the nearest 5c.
    In Australia, a Suppier's Tax Invoice is a legal document and MUST be matched on the system at data entry time. Prior to PL 46, this was able to be achieved by using Rounding by Currency and overriding the rounding in the AP Invoice to match the rounding of the supplier's Tax Invoice.
    Perhaps a flag per AR and AP stream will solve the Developers problem of Data Inconsistancy to the flag, as this is the reason given for the change in PL 46.

    Hello Gary,
    If you feel that there is certain inconsistency of functionality between individual patches, please raise a standard Customer Message.
    Currently, SAP Business One does not support feature of user-defined rounding to whatever value usually determined by the coin of the lowest value in the country (such as 0.05, 0.20, or 0.5). We are considering to introduce certain solution to enable this in next major release after 8.8.
    Peter Dominik
    B1 Solution Management

Maybe you are looking for

  • AP CREDIT NOTE ISSUE

    Hello Sir/Madam I am vilas maskey . our one client facing problem during inserting record of AP credit memo for one quantity of one item In sap b1 It ask for serial no of batch for 1 quantity and we find there Is not created serial no for 1 Quantity

  • Illustrator - problem with font Windsor

    Hello, i work on my old PC and now i have brand new PC with clean install Win 7, 64 bit + Adobe Suite CS6 + updates. On old PC i open my graphic with font Windsor with no problem. On new PC in Illustrator i open graphic and program give me info "miss

  • Carry our Sourcing link not present in EP for SRM 7.0

    Hi We are using SRM 7.0. When we create a Shopping Cart then as per the configurations made it should be present in Purchaser's Sourcing cockpit for further action. However when we log in as Purchaser we do not see the "Carry Out Sourcing" link at al

  • Instagram smart album

    Anybody know how I can create an instagram smart album?  The photo resolutions are all a little different but many are 2448 x 2448.  However, all the photo resolutions are a square (e.g. 648 x 648, or 1028 x 1028).  However, for whatever I can't seem

  • I am confused why my reply includes  content that is not permitted

    I tried to reply to this topic: http://discussions.apple.com/thread.jspa?threadID=2691835&tstart=0 and got the "you have included content in your post that is not permitted": I can't even quote my reply here (was met with the same warning) and am qui