Floor function

I am using Livecycle to build a autocalculated form.  One of the fields that I am using is an output from Floor formula as used in excel.  Eg : Field A = input intiger. Field B = Floor(A*30%,1200). that is  -> if A=110000
, then B=(110000*30%,1200). Output is 32400. 
How can I get the same output in livecyle as there is no option for 'significance' field in the floor formula that livecycle uses.

There are LiveCycle  forums bu this forum is for forms developed with Acrobat form tools.
You could add code to perform the rounding.
LiveCycle ES3 FormCalc Reference

Similar Messages

  • Rounding down using the floor function

    I need some help rounding down to the nearest 5 using the floor function.
    My code appears to be correct but I'm not getting the wrong result.
    create or replace
    TRIGGER "SALE_CALC" BEFORE
    INSERT OR
    UPDATE ON Prs FOR EACH Row
    BEGIN
    :New.Prsvf9c := (floor((:New.Prsprsc - :new.prsvf1c)/5)*5);
    END;
    *:New.Prsprsc = 100.00 and :new.prsvf1c = 46.00*
    After the trigger executes I get a result of *54.00*, which is the result before the rounding should take place. The result should be *50.00!*
    What am I doing wrong?

    The code you posted appears to produce the results you expect if the data is what you say it is
    SQL> create table prs(
      2    Prsvf9c number,
      3    Prsprsc number,
      4    prsvf1c number
      5  );
    Table created.
    SQL> create or replace
      2  TRIGGER "SALE_CALC" BEFORE
      3  INSERT OR
      4  UPDATE ON Prs FOR EACH Row
      5  BEGIN
      6
      7  :New.Prsvf9c := (floor((:New.Prsprsc - :new.prsvf1c)/5)*5);
      8
      9  END;
    10  /
    Trigger created.
    SQL> insert into prs( Prsprsc , prsvf1c )
      2    values( 100, 46 );
    1 row created.
    SQL> select * from prs;
       PRSVF9C    PRSPRSC    PRSVF1C
            50        100         46If you're seeing something different, it would be very helpful if you did something like I did here and post a reproducible test case.
    Incidentally, I'm not sure why you would have columns named prsvf1c and Prsvf9c but if that implies that you've denormalized your table to store 9 values rather than creating a child table with up to 9 rows, that's unlikely to be a reasonable solution.
    Justin

  • Formula Node Floor(x) Produces Different Result

    Hi, A search didn't find anything about the Floor(x) function, so... I'm using LabVIEW 6.0.2, and the Floor(x)function in a Formula Node seems to be producing different results depending on previous calculations. I've got the following 2 lines in a Formula Node:
    MSS = Ref / RefDiv;
    MDN = floor(RF / MSS);
    Ref is always 20.0M, RefDiv always 500.0, and for this calcualtion RF is always 1539.4, all numbers Double with 6 digits of precision. I generate an array of frequencies given a start, step, and frequency count. These frequencies then go to a subVI with a Formula Node that calculates the byte values to send to a couple PLLs.
    If Start = 70.1, Step = .025, and Count = 20, at frequency 70.2 the Floor function gives 38.485.
    If Start = 70.0, Step = .025, and Count = 20, at frequency 70.2 the Floor function gives 38.484.
    I've omitted some calc steps here, but I've verified the starting values in the subVI are the same in both cases. Why the result changes I'm hoping someone can tell me...
    Thanks,
    Steve

    I want to thank those involved again for their help. With ideas and hints from others I found a solution without scaling.
    In recap, what had bothered me was it *appeared* like the same subVI was giving correct results one time and incorrect results only randomly. While I understand binary fractional imprecision, I wasn't doing any looped calculations 100+ times or anything.
    I did some more checking though. The problem was indeed introduced by cumulative fractional addition. In this case 10 additions were enought to cause the error. Apparently, floor(71.199_94) produces 72.0. However, using a shift register and constant fraction to add an offset to produce an array introduces enough error in under 10 iterations to be a problem. By the time the loop got to what was supposed to be 72.0, it was actually 71.199_84 or something, enough to throw the floor function. Now I understand why the error occurred, and why it wasn't a problem before.
    I fixed this problem by changing the real frequency number to a I32 before introduction to the formula node. This corrected the error introduced by the fractional addition by forcing 71.199_84 to 72, instead of letting it propagate through the rest of the calculations. And it was a whole lot easier than changing all the VIs to allow scaling! Also, I prefer to know where and why the problem happened, instead of just scaling all my calcualtions. Maybe I can recoginse potential problems in the future.
    My boss wants to go back and look at his program to see if HPVee somehow bypassed the problem or if he did the calculations differently.
    Thanks again for the insight and help,
    Steve

  • Floor in mdx query

    Hi,
    I need like sql floor function in mdx query.
    select<//span> FLOOR(DATEDIFF(day, '2007-11-22', getDate()) / 365.25)--
    act as floor function in mdx query.
    indu

    Hi Elvis,
    Thank you for reply.
    my requirement is i need current age from current date,in my cube i have dob attribute.
    so i need to find current age between dob to curretn date.
    hence  wrote below query.
    With
    MEMBER
    [DOB]
    AS
    DATEDIFF('d',[ Employee].[EmployeeBirth].CurrentMember.Name, Now() )/ 365.25
    Select
    {[DOB]}
    on columns ,
    NON
    EMPTY
    topcount([Employee].[EmployeeBirth].[ EmployeeBirth],100,[Measures].[Dummy])
    }ON
    ROWS From [cubename]
    here data returned like this.
    68.6050650239562
    so i need 68 only, i need to remove after decimal.because i am using floor function in sql.
    In mdx which function should i use?
    Please help me.
    Round function is round off value after decimal greater then 5 (69).
    indu

  • Add a mathematical function in Query Designer ?

    Hi,
    Do you know if it is possible to add a function in the Query Designer on formula screen ? If yes ... how ?
    Thanks a lot,
    CG.

    You can use the CEIL and FLOOR Functions for this
    Suppose you have a Key Figure K.F . hide this key figure and create a new formula Key Figure and create a formula as shown below.
    ( FRAC ( 'K.F' ) >= 0.5 ) * CEIL ( 'K.F' ) + ( FRAC ( 'K.F' ) < 0.5 ) * FLOOR ('K.F' )
    CEIL, FLOOR and FRAC will be available under Mathematical Functions

  • Calculating fractions of hours from time date range

    Hello friends,
    I'm using sql server 2008 r2 and I have a table called attendance with the following fields
    attendance_no    int
    attendance_date    date
    attendance_timein    time(7)
    attendance_timeout    time(7)
    emp_id    int   
    and another table called employee with the following fields
    emp_id int
    emp_name  varchar(50)
    emp_tel  varchar(50)
    I need to calculate the total minutes worked as well as total hours worked for each employee with in a specified date range and I created the below query which working fine but it is not calculating the  fractions of hours, I mean when an employee works
    for example 7 and half hours, its showing just 7 hours instead of 7.5 hours.
    SELECT a.attendance_date As 'Date',e.emp_id As 'ID',e.emp_name As 'Name',e.emp_tel As 'Telephone',left(a.attendance_timein,8)[Time in],left(a.attendance_timeout,8)[Time out],
       + CAST(DATEDIFF(second, attendance_timein, attendance_timeout) / 60 AS NVARCHAR(50)) As 'Total minutes',
       CAST(DATEDIFF(second,attendance_timein,attendance_timeout) / 60 /60 % 60 AS NVARCHAR(50)) As 'Total hours'
        from attendance a join employee e on e.emp_id=a.emp_id and a.attendance_date between '2014-11-06' and '2014-11-08'  and e.emp_tel='65098009'
    I would appreciate any help about this.
    Thanks in advance
    Mohamoud

    If I understand correctly, according to
    Mohamoud's data sample, there is already Total minutes in the input (the above
    table Mohamoud posted)
    and all he need is a simple convert to decimal and the divided by 60.
    select [Total minutes] / 60.c
    Mohamoud,
    is that correct?
    The result show that you might need some rounding. for example 31/60 is 0.516666 while you show us 0.5
    Please clarify if you need rounding and how many characters after the dot you need (this can be done using declaring decimal(x,y), converting, or multipla and using floor function, etc')
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to use mathematical calculations in abap

    Hi!
                                In my program,
                                 I declared one variable as w_h(2) type n.
    i am doing calculation as,
    w_h = 100 /60.
    its giving the o/p as 2(1.66...). but in 1.6 i want that 1 alone as my o/p.normally math function floor() is there to bring the o/p as 1. in abap how to use this floor function. or any other possible is there to get the o/p as 1.could anybody plz help me.

    define w_h  as i.
    data: w_h  type i.
    Edited by: mayank jain on Sep 8, 2009 9:42 AM

  • Mapping conversion of source value 4448601.75 to target value 448601

    Mapping conversion of source value 4448601.75 to target value 4448601 or source value 999999.99 to target value 999999
    Here standard functions like round, floor, ceil..etc, will not work because they will convert source value 4448601.75 to 4448602 and source value 999999.99 to 1000000.
    Also i may have blank or white spaces coming in front of the source value from R/3 side like _____999999.99 and i want the value at the target side as _____999999. Here _____ representing blank or white spaces.
    How i will do the mapping, can someone help me out.
    Thanks,
    Ashish
    Edited by: Ashish Soni on Sep 6, 2008 9:53 PM

    >>Here standard functions like round, floor, ceil..etc, will not work because they will convert source value 4448601.75 to 4448602 and source value 999999.99 to 1000000.
    No....! The floor function can be used. It returns the largest integer that is not greater than the passed value. However this will also trim the spaces.
    So u can write a UDF that accept the number and substring till the decimal point and returns it.
    Try this.. It works..
    public String converv(String a,Container container)
    return a.substring(0,a.indexOf('.'));
    Thanks
    SaNv...

  • Filtering based on Fact Columns makes the result different?

    Dear All,
    I have an analysis report for Publisher, there are several columns, for example,
    Col A = ROUND(Col B * Col C / Col D, 0) Whereas Col B, Col C and Col D are integers
    Col E = ROUND(Col F * Col C / Col D, 0) Whereas Col F, Col C and Col D are integers
    Filter: Col G is not null, Whereas Col G is fact column, Integer
    I have the case is that
    Col B = 120, Col C = 4, Col D = 14, Col F = 10
    If Filter is not applied:
    Col A = Round(120 * 4/14, 0) = 34
    Col E = Round (120 * 10/14, 0) = 86
    When Filter is applied,
    Col A = Round (Floor(120  * 4/14), 0) = 34
    Col E = Round(Floor(120 * 10/14), 0) = 85
    C

    If you want to avoid the floor function Use (120*10/14.0)
    If all the values in a division are integers, OBIEE uses a Floor function automatically.
    SO CAST either the numerator or the denominator to DOUBLE and then run your calculations, the floor function will not be applied.

  • Crosstab Query re Grouping Data into Value Ranges

    Hi
    I am trying to analyse some data in a Crosstab & have a query re grouping.
    The data contains sales transaction info such as selling price, quantity etc. I would like to create a grouping in the Crosstab based on a sale price range (eg £0 - £10, £10 - £20 etc) so that I can show the total quantity sold in each price range.
    To date my method has been to create a formula with Select Case which identifies each transaction into a price range. I would then use this formula in my Crosstab. The main issue with this method is that there will be a large number of Cases & the possibility this will need to be added to / modified going forward.
    Whilst I think this will work I am hoping there is better method to follow?
    Thanks
    Jon

    Hi Jamie,
    Thank you for your help.
    I'm looking to group in increments of 10 so it looks like the Floor function will do the trick, thank you.
    I'll probably use an If statement to do a "block" of prices at either end of the scale (ie < 100 then 100, > 1000 then 1000+ else Floor ({Sales Field},10). Hopefully this way I'll reduce the overall no of rows.
    Thanks again for your help.
    Jon

  • 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 ...

  • OA Framework Larger Numbers in view objects

    Hi,
    We have an OAF page with a simple table layout. One of the field allows user to enter a number. The next field is calculated automatically based on user input in the earlier field upon clicking save button.
    An example is:
    Field 1 (Number, user input) : 100
    Field 2 (Constant): 20
    Field 3(Derived): (Field 1 - Field 2) => 100 - 20 = 80
    In one of the cases, user has enter an extremely large number value in the input field
    Field 1: 100,000,000,000,000,000,000.00 (22 digit number)
    Field 2: 1,620.22
    The derived field value in this case appears as 100,000,000,000,000,000,000.00, same as field 1.
    I notice that if the field 1 is having 21 digits, the subtraction happens but the decimal is rounded off. Here the field 2 is 9,999,999,999,999,998,000.00.
    We have not used round, ceil or floor functions in the view object query. There is no specific number precision defined to the number fields in the VO.
    In sql*plus, this can be avoided using 'set numformat '. How can we avoid this issue from the framework ?
    Thanks,
    Ashwin

    Before you come to the above screen, it might have asked you for database credentials. There you need to provide the username and password. Then in the following screen(the screenshot you gave), just above the Tables, views etc checkboxes you can see a poplist called Database Schema with available schemas in the selected db.
    If the EO wizard didn't ask for any db then you first needs to create a connetion in JDev with connections manager.
    Regards,
    Peddi

  • Quantity

    Hi,
    A quantity of five items will appear as 5.0 for example.  . So we need to pass 5 in the target.
    Validations:
    We can not have quantity in decimals (e.g. 5.1,1.3,23.5,1111.6 0.5 etc)
    Quantity can not be non numeric or blank.
    Thanks in Advance.
    I need UDF or v can do in Graphical Mapping

    Step1 )
    use below code to check if the data eneterd is Numeric..
    for (int i = 0; i < str.length(); i++) {
                //If we find a non-digit character we return false.
                if (!Character.isDigit(str.charAt(i)))
                    return false;
            return true; 
    Step 2)
    if it is numeric, then use the Floor function to give you the non-Decimal value; and it does work n gives the correct number..
    example ; 
    for  5.1 it gives 5
    for 1.3 it gives 1
    for 23.5 it gives 23  etc...
    Step 3)
    to check if the numebr is null; in graphical mapping use constant(with null)  compare witrh data using Equals and  then use Boolean funtion if then

  • Number Precision- JExcel

    Dear friends,
    I am using JExcel API to parse an Excel file. i would like to know how to retrieve a number value in a formula cell rounded off to its nearest integer. I don't want to use any ceiling/floor function but would like to use the functionalities provided with JExcel.
    Kindly help.
    Subhash

    lxl.NumberCell.getNumberFormat() gives you whatever format Excel was using. If that isn't the format you need, I don't see anything in JExcel that will do it.

  • Removing the decimal places of currency field

    Hi Gurus,
    I have a currency type field ( to be more specific a field like BSEG-WRBTR) .
    How do i eliminate the decimal places for this field.
    ie if the value is 345678.91, i need to make it 345678.
    Is there a standard keyword or something for this?
    Points will be given to all the helpful answers.
    Thanks,
    Nobin.

    You can use the FLOOR function to get the largest integer value without decimal.
    Like:
    DATA: W_RESULT TYPE I.
    W_RESULT = FLOOR( P_AMT ).
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Fbl5n - calculate net due date

    Hey All Gurus, I am writting a report and want to calculate the net due date which we see in FBL5N. This is a customer aging report, and I have tried using fm DETERMINE_DUE_DATE or J_1A_SD_CI_DATA_GET... is there any other formula that I can use from

  • Error when I start xl reporter

    Hi, i have SBO 2007, SP: 00, PL: 47 when start the XL reporter this message was appear : Unable to start XL Reporter. Object variable or With block variable not set and when i try to start it from his file this massage was appear: Run time error '739

  • Publish html5

    Hi, I made a presentation in html5 for tablet user and I would like to know how can they view it on their tablet? Can I just copy the files on the tablet? Doesn't seem to work by the way... Do I have to upload it on my web page or something else? I h

  • Organizer Catalog

    How can I move a video project between different catalogs in organizer?

  • Error in snap id in sap

    i ws workin on my laptop standalone server.. and system shutdown .. and rebooted when i strated the server again it gives eror "snap-in creation failed"... the snap-in is not created,it may not be installed properly . name: sap r/3 manager CLSID:{633