Ceil function

i have amt field of type p decimals.
i want next higher value of this field
like if in amt field i have value 5.3, i shuld get 6.
for that i want to use ceil function. i m writing program line code in smartform
it is not acception ceil function. tell me how to do it.

Hi nidhi,
change your type from P to F,
then your problem sloves.
regards,
seshu.

Similar Messages

  • Ceiling Function in Expression Builder in an Update Field Value Workflow

    I'm trying to use the "ceiling" function in an update value workflow. I want to multiple the number value in field A by the currency value in field B and have that new value display in field C. But I also want to round up or ceiling the resulting value to the nearest $0.10. Here is what I want to do, but this is not working. PLEASE HELP.
    EXPRESSION BUILDER FUNCTION
    FIELD C = CEILING((FIELDA*FIELDB)+FIELDB,0.1)
    Edited by: gprobertson on Feb 15, 2010 10:20 AM

    Hi, I dont think this function is supported in workflow expressions. It is only available in reporting / analytics. Even there it only Rounds a noninteger numerical expression to the next highest integer. Even the function round doesnt seem to be available in workflow functions list
    -- Venky CRMIT

  • Combine floor() and ceiling() functions

    I need to combine the functionality provided by both floor() and ceiling() functions using
    normal pl/sql function or proc. and without using any built-in functions in it.

    And wtf is the purpose of not using 'any built-in functions in it'?

  • CEILING Function in Analytics

    I am trying to do this in Reporting/Analytics as well, and I can ROUND properly but I cannot CEILING. Here is my expression in my report:
    CEILING(Custom Object 2 Custom Metrics".S_NUM_0), 1)
    Why wouldn't this work? I want to CEILING up to the next $0.10. Or the next $0.05.

    The Ceiling function rounds any non-integer numerical value to the next highest integer value. If the value is an integer to begin with, then Ceiling will return the same value.
    Example: Ceiling(65,667,499.24) = 65667500.00
    Your expression doesn't work because Ceiling does not accept any additional parameters (,1) and won't round decimal values, it only returns integers.
    ROUND function does accept a parameter telling it the decimal precision, so this may be a better option.

  • Function or trigger to calculate cost

    Hi,
    I have a question regarding a function or trigger. Not sure what to use.
    I have the following table:
    CREATE TABLE STAY_LOG
         LOGID NUMBER(4) NOT NULL,
         FLIGHTID NUMBER(5),
         ARRIVALDATE DATE,
         DEPARTUREDATE DATE,
         COST NUMBER(6),
         CONSTRAINT stlg_pk PRIMARY KEY(LOGID),
         CONSTRAINT fk_stlg_flightid
           FOREIGN KEY (.....)
           REFERENCES ...(...)
    );The cost attribute should be calculated automatically by the following formula: departuredate-arrivaldaten in hrs * hour_cost (hour_cost is retrieved from another table).
    I wrote the following function:
    CREATE OR REPLACE FUNCTION calc_cost2 (fid IN INTEGER)
    RETURN INTEGER
    IS
         hcharge INTEGER;
         duration INTEGER;
    BEGIN
         select ceil((departuredate-arrivaldate)*24) into duration from stay_log where flightid = fid;
         select hr_charge into hcharge from ......................;
         return(duration*hcharge);
    END;That does not seem to work when I insert a value into the stay_log table and call the function calc_cost2 in the column cost.
    Also rather than passing the fid (flightid) as an argument can you retrieve it from the column flightid from the row it is being processed for?
    Any help appreciated.

    Hi,
    I want to add a bit to what Francois has written...
    Probably the best mentioned option is to go for the third one, because of transparency. You will see how the column is populated right in your code and not hidden in a trigger.
    A trigger might be your choice if the inserts are coming from different sources (programs).
    But why not simply include your calculation directly in your insert statement?
    Something likeINSERT into stay_log (...,flightid, arrivaldate, departuredate, cost, ...) VALUES(..., 1, SYSDATE-1, SYSDATE, CEIL(SYSDATE-(SYSDATE-1))*24, ...); shall do it for you.
    Edited by: Guido on Oct 24, 2008 10:49 AM
    Corrected the syntax for the CEIL function.

  • Functions oracle help required

    hai
    select  99.9899 from dualafter decimal i want only 2 digits
    i want 99.99 SHOULD BE MY ANSWER
    pls
    i used ceil and floor
    it is not working
    so help
    S

    hi there trunc function is appropiate because in round and ceil function return
    rounded value that is 99.99
    ie
    SELECT ROUND(99.9899,2) FROM dual;
    99.99
    SELECT ceil(99.9899) FROM dual;
    100
    SELECT floor(99.9899) FROM dual;
    99but the trunc
    Returns n truncated to m decimal places, where m and n are numeric arguments. If m is omitted, truncates to 0 places. If m is negative, truncates (makes zero) m digits to the left of the decimal point.
    select trunc(99.9899,2) from dual;
    99.98regards
    Hitesh
    Edited by: Hitesh Nirkhey on Feb 17, 2011 1:16 PM

  • NTILE Function

    After knowing usage of NTILE analytical function, i started using it to divide my rows into batches. However I'd like to pass the expression dynamically (depending on the row count), but unfortunately I see some limitations inhibit me from achieving it. The reason I want to do this dynamically is when there are rows <= expression value, NTILE function forms one batch per each record which I don't wish to happen.
    If you observe in the below example, it creates 10 batches/buckets when there are only 10 rows, where I wish to have only 1 batch.
    SQL> drop table r_dummy;
    Table dropped.
    SQL>
    SQL> create table r_dummy
      2  as
      3  select level id
      4  from dual
      5  connect by level<=10;
    Table created.
    SQL>
    SQL> select ntile(10) over(order by id) batch_no,id
      2  from r_dummy;
      BATCH_NO         ID
             1          1
             2          2
             3          3
             4          4
             5          5
             6          6
             7          7
             8          8
             9          9
            10         10
    10 rows selected.
    SQL>
    SQL> select ceil(count(*)/10) from r_dummy;
    CEIL(COUNT(*)/10)
                    1
    SQL>I wish to use above same ceil function in my actual query but
    with t as
    select id, ceil((count(*) over())/10) bucket_size
    from r_dummy
    select id,ntile(bucket_size) over(order by id) batch_no
    from t;
    ERROR at line 6:
    ORA-30488: argument should be a function of expressions in PARTITION BYI had seen the same question being asked by Sven Weller [url https://forums.oracle.com/forums/thread.jspa?threadID=587782]here, would like to know if there is any workaround available to this.
    Please help me.

    Hi,
    not sure it that fits your need, but I came to this:select batch_no
    , least(ntile(&&DOP.) over (order by batch_no), 1+floor(row_number() over (order by batch_no)/(&&MBPG.+1))) grpid
    from t;You'd use 2 parameters :
    - DOP (Degree of parallelism) = the max number of group to assign batch_unit
    - MBPG (Min BatchUnit Per Group) = the min number of batch_unit in a group.
    Ok, if only 10 batch unit in total :Scott@my11g SQL>define DOP=4
    Scott@my11g SQL>define MBPG=10
    Scott@my11g SQL>/
      BATCH_NO      GRPID
             1          1
             2          1
             3          1
             4          1
             5          1
             6          1
             7          1
             8          1
             9          1
            10          1
    10 rows selected.Now if 43 batch units :Scott@my11g SQL>/
      BATCH_NO      GRPID
             1          1
             2          1
             3          1
             4          1
             5          1
             6          1
             7          1
             8          1
             9          1
            10          1
            11          1
            12          2
            13          2
            14          2
            15          2
            16          2
            17          2
            18          2
            19          2
            20          2
            21          2
            22          2
            23          3
            24          3
            25          3
            26          3
            27          3
            28          3
            29          3
            30          3
            31          3
            32          3
            33          3
            34          4
            35          4
            36          4
            37          4
            38          4
            39          4
            40          4
            41          4
            42          4
            43          4
    43 rows selected.Just adjust DOP and MBPG as you like.

  • Rounding up in oracle 9i

    Dear all;
    I am looking for the best way to round up in all cases. In otherwords, if the result is 2.3333333 then it would round up to 3, or if the result is just 0.5, it should just round up to 1 or if the result is 1.1, it should round up to 2, the decimal place shouldnt matter. all help will greatly be appreciated.

    Have a look at the CEIL function:
    SQL> select ceil(2.333333) from dual;
          CEIL(2.333333)
                       3
    SQL> select ceil(0.5) from dual;
               CEIL(0.5)
                       1
    SQL> select ceil(1.1) from dual;
               CEIL(1.1)
                       2
    SQL> select ceil(3) from dual;
                 CEIL(3)
                       3
    SQL> select ceil(-3.1) from dual;
              CEIL(-3.1)
                      -3
    SQL> select ceil(-2.9) from dual;
              CEIL(-2.9)
                      -2

  • Rounding off to nearest whole number without condition

    hi,
    i want to round a real number to an integer value,,wihout any conditions like
    10.01 should be 11
    10.1 should be 11 and like that
    is it posible to do it?
    thanks in advance.
    amit

    It doesn't look like you are trying to round to the nearest whole number here. It looks like you are trying to find the smallest integer value that is greater than or equal to the real number. If so, you would want to use the CEIL function (i.e.
      1  SELECT CEIL(10.01)
      2*   FROM dual
    SCOTT @ hp92 Local> /
    CEIL(10.01)
             11Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Date difference calculation

    Hello Everyone,
    We need to calculate a day difference between two days. There is many suggestions about using the following approach:
    (date1.getTime() - date2.getTime())/86400000.
    This seems to work until we hit a Daylight Savings Time issue and nobody seems to talk about that. When in April, for example, we get 1 hour less then the result of the calculation above will not be the whole number. Well, we can use Math.ceil() function for that. Then, in October, we get 1 hour back so now we have to use Math.floor() function to get the right result.
    Does anybody have any idea as to when to use one or another. I was thinking of using modulus division. If the result is not equal to zero then we have to apply one of those functions. The question now is, how to identify which function to apply? Or is there any other, less cumbersome way to properly get day difference between two dates?
    Any help will be greatly appreciated.
    Thanks,
    Yourii

    I think i figured out how to calculate the difference in days with Daylight Savings Time changes. Here is the code:
         * This method returns difference in days between two Dates passed in.
         * It identifies Daylight Savings Time changes and automatically
         * adds or substracts one hour when needed ...
         private int dayDifference(java.util.Date date1, java.util.Date date2) {
         final long M_SECS_PER_DAY = 24*60*60*1000;
         final long M_SECS_PER_HOUR = 60*60*1000;
         long days = (date1.getTime() - date2.getTime());     
         if (days%M_SECS_PER_DAY != 0) {
         if ((days + M_SECS_PER_HOUR)%M_SECS_PER_DAY == 0) {
         System.out.println("Adding one hour ...");
         days += M_SECS_PER_HOUR;
         } else {
         System.out.println("Substracting one hour ...");
         days -= M_SECS_PER_HOUR;
         } else {
         System.out.println("No alterations made ...");
         return (int)(days / M_SECS_PER_DAY);
    Let me know what you think ...

  • Round up a float number

    Hi!
    Which Math function do I have to use to round up a float number ? I thought the correct one was the Math.ceil() function but I don't get what I need. I mean, which is the correct function to get the following result:
    Math.function(2.75)=3
    Thanks

    This is what I get:
    Math.ceil(2.75)=2I get 3.0 for that calculation. You must be doing something besides the raw calculation. Here's my code that tests it:public static void main(String[] args) {
      System.out.println(Math.ceil(2.75));
    }Let's see yours.
    PC&#178;

  • Always round up to nearest whole in APO DP

    Hi
    there is a requirement to always round up data to nearest whole number. number should be always rounded above and not rounded down.
    Example a value of 0.07 should be rounded to 1
    a value of 1.25 should be rounded to 2
    a value of 1.75 should be rounded to 2
    a value of 1.07 should be rounded to 2
    and so on
    Is there a way i can achieve in APO DP by some settings/paramater/config/macro/exit etc etc - i am on SCM 7.0
    Thanks,
    TJ

    Tejinder
    Try using the CEIL() function in a macro.
    Rishi Menon

  • Pleas help with rounding decimal field

    I have a totals field that is summing several fields. I wish to have this totals field provide a rounded sum. I've tried setting the trailing digits to 0 but it will not round up, only round down. I have a display pattern for the field of num{($z,zzz,zz9.99)} . Example 162.59 is displaying 162.00 in total field instead of 163.00. Is there something I'm missing or am I missunderstanding how a decimal field works?
    code in "calculate" event:
    var test=xfa.form.topmostSubform.personnel_page.person_1.salary_cost1.rawValue+
    xfa.form.topmostSubform.personnel_page.person_2.salary_cost2.rawValue+
    xfa.form.topmostSubform.personnel_page.person_3.salary_cost3.rawValue+
    xfa.form.topmostSubform.personnel_page.person_4.salary_cost4.rawValue+
    xfa.form.topmostSubform.personnel_page.person_5.salary_cost5.rawValue+
    xfa.form.topmostSubform.personnel_page.person_6.salary_cost6.rawValue+
    xfa.form.topmostSubform.personnel_page.person_7.salary_cost7.rawValue+
    xfa.form.topmostSubform.personnel_page.person_8.salary_cost8.rawValue+
    xfa.form.topmostSubform.personnel_page.person_9.salary_cost9.rawValue+
    xfa.form.topmostSubform.personnel_page.person_10.salary_cost10.rawValue;
    //this rounds the value upon exit of field
    var result = MATH.round(test.value);
    this.value = result;

    In FormCalc you have a function which do just what you are looking for..
    Ceil(162.59)
    Put it in a messageBox and see the output..
    form1.#subform[0].Button1::click - (FormCalc, client)
    $host.messageBox(Ceil(162.59));
    OR
    You can use the Ceil function of the MATH object in Java Script.
    form1.#subform[0].Button1::click - (JavaScript, client)
    xfa.host.messageBox("" + Math.ceil(162.59));
    Thanks
    Srini

  • Help with MOD and DIV

    I have to calculate minutes to debit from an account based on
    the call length (rounded to the next full minute). But I'm having
    issues since I don't know the CF syntax for what I need to do.
    Here is my test code (the call "Length" is dynamic in the
    real application):
    <cfoutput>
    <cfset Length = 90>
    <cfset xMin = Round(#Length#/60)>
    <cfset yMin = (#Length# Mod 60)>
    xMin = #xMin#<br />
    yMin = #yMin#<br />
    <CFIF yMin GT 0>
    <cfset xMin = (xMin + 1)>
    </CFIF>
    Minutes Debited = #xMin#<br />
    </cfoutput>
    Right now, that outputs 3 minutes, and it should be 2 (but
    it's 3 because of the "Round" function, obviously)
    I'd LIKE to be able to write this: <cfset xMin = (#Length#
    DIV 60)>
    How would I do that in ColdFusion? I don't have my books
    handy and I've tried looking it up online, but only find results
    dealing with the HTML div tag which isn't what I need. Hard to look
    up something when you don't know what you're looking for. Ugh. I'm
    hoping someone can help. I'm sure it's something simple.
    thanks!

    I think what you're looking for is the ceiling function which
    "Determines the closest integer that is greater than a specified
    number."
    <cfset xMin = Ceiling(Length/60)>

  • Rounding of the Values

    Hi All,
      I have a requirement where the values should be rounded off. This is based on the currency key and Curreny Decimals i.e. For EUR - 2 decimals.
    Now i have value i.e. 389.78 which in turn should be rounded to 390. I used CEIL Function it is worked and rounded to 390. But in other cases i.e. 389.01, it is getting rounded to 390. As per arithmetic, if the value is greater than 5, then the rounding should be done.
    Could you please clarify on this.
    Looking forward for your quick response on this.
    Thanks for your cooperation.
    Regards,
    Dinesh.

    Hi All,
           This is the code where my values are passed into another work area.
    For example. if the curreny key is "CLP" the values is 389.7800. it should be rounded off to 390. In case if it is 389.01, it should be rounded off or not. Actual it should not be as per arthimetic. Please give me ur suggestion which function i can use. I used CEIL but it considers for all roundings. Code which i used to place.
             WRITE wa_final_process1-total TO wa_final_mag-p_amount
             CURRENCY p_curr DECIMALS p_decip
             LEFT-JUSTIFIED NO-GROUPING NO-SIGN.
    Looking for ur response.
    Thank you.
    regards,
    Dinesh

Maybe you are looking for

  • PROBLEM IN CREATION P.O

    Dear cons I created a pur. requisition. when I create a p.o based on this pur. requisition the system gives an error message that 'NO SELECTABLE ITEMS EXIST FOR PURCHASE REQUISITION I_BANFN. PL. solve it . whether it is a basis reletad (autherization

  • Problem in installing new version skype as older v...

    Hi all, the issue is that I cannot install the new skype version as the old one is still running on my laptop despite I have uninstall it. Please help n thansk to provide some suggesion.

  • SAPScript: includung a domain documentation in a data element documentation

    Dear ABAPers, I have a couple of (self-defined) DDIC data elements referring all to the same domain. How does the SAPScript INCLUDE-command need to look like in order to include the domains text in the data element text? (which object and which ID ne

  • Placed TIFFs or JPEGs: Is there a High Quality Display setting?

    Does Illustrator CS5 have a setting like InDesign does where you can specify to make a placed TIFF or JPEG display in a high quality mode? Thanks-

  • Is Developer Release 6.0 shipping yet?

    Is Developer 6.0 shipping yet in the UK? Release date was given as end March, and yet I can find NO mention at all on any Oracle Website announcing it. Is it released yet or not? Simon Hedges Gloucester UK null