How I afford two fields and round?

I need an average of two fields and then round the whole number closest. The two fields each will always have a value.

If someone could help me out, I would appreciate it.

T.

Assuming you want it's a custom script calcuation for a field, it might look like this:

Custom calculation script

(function () {}

Get the field values as numbers

var v1 = + getField("text1").value;

var v2 = + getField("text2").value;

Set the value of this field to the average, rounded

Event.Value = Math.floor ((v1 + v2) / 2);

})();

More information about the Math.floor method can be found in any decent JavaScript reference.

Tags: Acrobat

Similar Questions

  • How to add two fields and show the result in a third

    All,
    I have 2 InputText field; both are related to the fields of the associated database.

    I want to display the sum of these two fields on a text output.

    I declare the value of the output in this way text link:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.kmGeldMlp.value}

    But I get this error:
    Cannot find resource for bundle java.util.PropertyResourceBundle, key el.convert

    ADF_FACES - 60097:Weitere desKomitees find DEM Fehlerlog einen entry as servers, der mit: ADF_FACES - 60096:Server - Exception while PPR, beginnt #3

    If I declare the value binding to contain the field even two times:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.summeDB.value}
    It works as expected, but it's not really what I need...

    Any ideas?

    Thanks in advance,
    Sergio.

    Edited by: user5414451 the 14.07.2011 02:57

    Try following:

    #{bindings.summeDB.inputValue.value + bindings.kmGeldMlp.inputValue.value}
    

    Jean Lou

  • How to compare two dates and find exactly

    How to compare two dates and find the exact age of the person, no one could be an age of child 2 days or a month, or other.

    I'd really appreciate if someone help o

    Concerning

    After spending 2 hours, I go out with a solution by myself, how ever the function can be customize to check if the user enters date right.

    function findAge(subjectName,fromdate, todate) {
        console.log("findAge(fromdate, todate) is called now "+subjectName+"-->"+fromdate+"-->"+todate);
        if(todate) todate= new Date(todate);
        else todate= new Date();
    
        var age= [], fromdate= new Date(fromdate),
        y= [todate.getFullYear(), fromdate.getFullYear()],
        ydiff= y[0]-y[1],
        m= [todate.getMonth(), fromdate.getMonth()],
        mdiff= m[0]-m[1],
        d= [todate.getDate(), fromdate.getDate()],
        ddiff= d[0]-d[1];
    
        if(mdiff < 0 || (mdiff=== 0 && ddiff<0))--ydiff;
        if(mdiff<0) mdiff+= 11;
        if(ddiff<0){
            fromdate.setMonth(m[1]+1, 0);
            ddiff= fromdate.getDate()-d[1]+d[0];
            --mdiff;
        }
        if(ydiff> 0) age.push(ydiff+ ' year'+(ydiff> 1? 's ':' '));
        if(mdiff> 0) age.push(mdiff+ ' month'+(mdiff> 1? 's':''));
        if(ddiff> 0) age.push(ddiff+ ' day'+(ddiff> 1? 's':''));
        if(age.length>1) age.splice(age.length-1,0,' and ');
        console.log("===============================");
        console.log("Subject age is = "+age.join(''));
        console.log(" age Day = "+ddiff);
        console.log(" age Month = "+mdiff);
        console.log(" age Year = "+ydiff);
        console.log("===============================");
        var subjectAGE =  age.join('');
    
    }
    

    peardox Thanks for the reply

  • Formula: Add two fields and divide a

    Help!


    I'm figuring a field that requires information of 2 other fields. I need of field "STR_2" to calculate the sum of the 'STR_1' field and 1/2 of the field 'Level' (rounded down). I use the following formula in the field "Calculate Custom script":

    {If (this.getField("Level").value! == {this.getField("Level").defaultValue)}

    Event.Value = (Math.round ((this.getField("Level").value - 1) / 2) + (this.getField ("STR_1")));

    }

    else {}

    Event.target.defaultValue = Event.Value;

    }

    However, it keeps returning the value "0 [ObjectField]" when the value of the 'level' is 1 and 'STR_1' 2 (it should return a value of '2').

    When I use the following formula:

    {If (this.getField("Level").value! == {this.getField("Level").defaultValue)}

    Event.Value = (Math.round ((this.getField("Level").value - 1) / 2));

    }

    else {}

    Event.target.defaultValue = Event.Value;

    }

    It works very well, and I get a value of '0' (1/2 "Level" rounded down). So, how can I fix this so that I get the right calculation?

    Thanks in advance!

    (If that makes a difference, I use Acrobat Pro XI on a Windows 7 laptop).

    You should correct this line in your first script for:

    Event.Value = Math.round ((this.getField("Level").value - 1) / 2) + + this.getField ("STR_1") .value;

    But this calculation does not do what you say you want. It subtracts 1 to the value of the field level and divides the result in two and adds the value of STR_1, which is different from what you have described.

  • How to subtract two fields in a form?

    I am working on a form of spending and I everything works except one thing.

    Subtract all on payments reports on previous expenditures on the State of current spending. I'm looking at the tab to calculate the properties of text field.  But I don't see a way to remove my two fields.

    Then, I set up a field that contains a negative, except when I display the field in the form, the negative is positive.  I enter-1 as a default value to my field of 'subtraction '.  I was then several 1 negative against most of payment the amount so I can get a negative on the amount of the payment.  I was then going to add the negative on the amount of the payment for the total amount to pay and arrive at a net due, but it does not work.

    Here is the calculation I'm doing:

    Total spending (field calculated from all previous fields.)

    Deductible expense (entered by the user)

    NET check fresh (Total expenses - deductible).

    Can someone tell me how to proceed?

    Thank you

    Dennis

    With Acrobat, there are 3 options of calculations.

    "The field is the _____ of the following fields:" options are for the sum, product, average, min and max operations or actions that could be repeated on several fields. We do generally not subtract or divide several fields in action.

    'Simplified field notation' uses only the field names and values. The field names must begin with an alphabetic character and has no spaces or special characters. Cannot perform conditional control statements or functions. Special characters or spaces may be in domain names, if the JavaScript escape character precedes the special character or a space. 4 arithmetic operations can be performed.

    'Calculation of custom JavaScript' has no restrictions on field names, control statements, functions or mathematical operations. We have access to the field object and the value property of the field object.

  • How we concatinate two fields in OWB?

    I call source table EMPLOYEE. There are two fields name and surname of the employee table. The target table is DIM_EMPLOYEE.

    I need concatinate FIRST_NAME and LAST_NAME when copying data from EMPLOYEE to DIM_EMPLOYEE.

    What a transformation I use here to accomplish the tasks?

    Any help is appreciated.

    Thank you and as always this forum is useful and hellpful.

    Concerning

    Hello
    instead use Expression operator, of the transformation link FIRST_NAME and LAST_NAME group attributes of this operator and for the output of entry attribute specify expression as

    FIRST_NAME || LAST_NAME
    

    (it is preferable to use the expression builder that correctly adds the name of Group of entry attributes)

    [url http://download.oracle.com/docs/cd/B28359_01/owb.111/b31278/ref_data_flow_opers.htm#i1175750] Any operator expression

    Kind regards
    Oleg

  • How to compare two dates and times in BPEL?

    Hi all
    I need to compare two dates and times in a switch activity, but could not find any function for her.

    My switch like this activity:

    case Date1 > date2:
    do something;
    otherwise:
    do something;

    He is not such a function in 'The functions of Date' and can not find this function to xpath.

    IBE, there is no function for a period of time to make (less one date of another?...) If this return to the data compare question).

    Thank you.

    Hello

    Logic function as more/less function can be used to compare two dates so that same comapring two numbers.

    Ex: If your variable reception contains two pieces of data such as date1 and date2, then you can use format in condition switch below.

    XpathXpression (date1) > XpathXpression (date2)

    hope this will help you.

  • How to connect two computers and LAN

    I can't get my toshiba to interface with my desktop computer or to connect to the internet via a CAT5.
    I tried everything I know.

    I'm not too sure about the LAN MAC? He just will not connect even if the device is functioning properly.

    Any ideas?

    Here are the instructions how can connect the two computers.

    -First of all, you will need to disable the firewall.
    -Then you need to set the same workgroup on both computers
    -in the Lan Card Properties-> Protocol TCP/IP settings, you must assign the IP address manually. That is, a computer must use the 192.186.50.1 ip address and the other computer must be set to 192.186.50.2.
    -MAC address is fixed and cannot be changed. Each LAN card uses unique mac address

    After these settings, you must restart the portable computers (computers)

    PS: I recommend Google for details and further instructions.

  • linking two fields and fill in the two field based on the list drop-down selection box 1

    I work for a small social service agency VERY small non-profit and I try to get our paperwork until the twentieth century. I hope someone here can help me. I have adobe acrobat, but not of other adobe products. I converted our word document that we use for client notes in fillable pdf format and so far everyone is excited to try it. I have a huge problem that I can't understand. I have a customer named created drop-down list box that contains a list of 300 customers. Box 2 is named customer ID and will contain a unique identification code assigned to each customer.

    For example:

    CUSTOMER ID customer JANE DOE 12345678

    So here is my question how can I ensure that when Unetelle is selected 12345678 is already filled in the second field?

    I fill the drop-down list with the names of customer and then enter the customer ID as the value of exports. Note You must have a unique name for each client.

    If your customer ID starts at zero, then you must use a custom JavaScript, so you can keep the zero non significant.

    For the customer ID field, you can use the following custom JavaScript code:

    Event.Value = this.getField("DropBoxFieldName').valueAsString;

    You will need to change DropBoxFieldName name of the drop-down list.

    You will need a mechanism for updating the new customer form and IDs names.

  • How to join two fields with slightly different data

    I have two columns, I need joined, both keep the columns of numeric data, but are of type varchar2 (6). The problem is that one of the columns keeps leading zeros to ensure that all 6 characters are used, but not the other. And columns preserve leading zeros may vary how many zeros are in the number-based computing.

    For example, the column with zeros can contain the number 4200, which would mean that he would remain with 2 zeros as 004200. Or it could contain 320, which means that he would remain with 3 zeros as 000320.

    The other column that does not have leading zeros not only keeps the number, so, in the example above, it would keep 4200 and 320 respectively.

    Can someone help on how to join these columns so that they match? I guess I have to delete the zeros in one or add zeros in the other? I tried to use the trunc with zeros on the ground, but it did not work...

    The following sql code:

    M06.mbr06_prv_id has no zeros, prv647.provider_id zeros. See bold below...

    SELECT
    M06.mbr06_prv_id,
    prv647.Site_ID
    Of
    Odw.mbr06_mbr_elig m06
    JOIN THE
    Odw.prv647_prov_exp prv647
    WE
    M06.mbr06_prv_id = prv647.provider_id
    WHERE
    M06.mbr06_subs_id = "999999999 '

    BTW, I have no control on how this data is represented in a table... !

    Hello

    user12296489 wrote:
    ... I guess I have to delete the zeros in one or add zeros in the other?

    Yes, this is how I see.
    LTRIM removes given characters from the beginning of a string. LPAD adds characters at the beginning of a string. I would use LTRIM in this case, because if you use LTRIM, you probably need to handle a single column. If you use LPAD, you have to play with the two columns, as one of them still has the extra 0, and it sometimes needs them.

    I tried to use the trunc with zeros on the ground, but it did not work...

    TRUNC is working on the kinds or DATEs; you have VARCHAR2s. You can convert them to numbers, but then you risk of errors to cause bad data (and it linked to the wrong data).
    >

    The following sql code:

    M06.mbr06_prv_id has no zeros, prv647.provider_id zeros. See bold below...

    SELECT
    M06.mbr06_prv_id,
    prv647.Site_ID
    Of
    Odw.mbr06_mbr_elig m06
    JOIN THE
    Odw.prv647_prov_exp prv647
    WE
    M06.mbr06_prv_id = prv647.provider_id
    WHERE
    M06.mbr06_subs_id = "999999999 '

    If you are certain that m06.mbr06_prv_id never has extra characters, whereas the join condition can be

    ON   m06.mbr06_prv_id   = LTRIM ( prv647.provider_id
                                      , '0'
                           )
    

    If this isn't the case, CUT then the two columns.

    BTW, I have no control on how this data is represented in a table... !

    Report a bad design is for people who don't have not this control. Numbers are the number of columns, not VARCHAR2. If the ID really needs to be strings, they should be validated and standardized once, when they are placed in the table, no more, and more, in all queries that use these columns.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • How to compare two TABLES and different lines of list?

    I have two structural equal paintings aaa and bbb
    that (could) have different lines.

    How can I compare the tables and display different lines?

    Peter

    Something like this->

    SELECT aaa.*,'bbb' "Not present in" FROM aaa
    MINUS
    SELECT bbb.*,'bbb' "Not present in" FROM bbb
    UNION ALL
    (
    SELECT bbb.*,'aaa' "Not present in" FROM bbb
    MINUS
    SELECT aaa.*,'aaa' "Not present in" FROM aaa
    )
    

    Kind regards.

    LOULOU.

  • How to add two fields of a standard page

    Hi experts,

    I have a requirement according to the customer's requirement.

    I'm working on isupplier. in a particular standard page, I need to add 2 fileds that paid is the type of lookup and a field is messagetextinput.please give me the steps how to approach.

    Thanks in advance

    Hello

    1.), you can create this field through customization.

    2.) go to customize the link of the page (top-right)

    3.) click on the full view
    4.), click on create element

    5.), drop-down list, you can create items accordingly.

    This link may be useful

    http://www.semihuslu.com/Tutorial/OA%20Framework_Java.PDF

    thanx
    Pratap

  • How to select two channels and send to a series to write using the loop of the case

    I had a series write who have different orders to different situations. The same reading series should read both. How can I do it. Means that if I have a 500\r\nZ of the chain. I have a case, it should be - Zand 500\r\n other case + 500\r\n Z. But for boyh these cases must be read with a write serail. How can I do ITI. Help, please

    You can't guarantee that these two conditions would not be affected at the same time.  You will need to send a separate command for each condition.

    In addition, using EQUALS on floating points is dangerous.  You could never get the condition because a little really low could be turned off.

  • How to compare two fields in two separate databases

    Hello

    Can we compare two columns in two separate databases with a single script.



    See you soon

    Sexy

    Hello

    If you mean Oracle to SQL Server while you'd have to put the hand in the Pocket and buy ODBC connectivity for this...

    If it's just one large may export your data and import into an Oracle table and make your unique comparison.

    Kind regards

    Robert.

  • Subtracting two fields and button

    I'm trying to subtract text Text11 11.1 and there total, Text11.2, I tried different from Java and FromCals. Help, please!

    Also is it possible to add a button that is bound to the pencil tool on a form?

    Hmmm. try to remove value formatting in the Time2Num function option.

    var Interval = Time2Num (StopTask) - Time2Num (StartTask)

    Steve

Maybe you are looking for

  • unboundle

    How to get a scale of FRF components, I want to use the data to build the chart

  • Windows Update error 80070005 - most likely caused by a Windows Update Agent 3.0 installation - how to solve?

    I am running Windows 7 RTM and stupidly installed Windows Update Agent 3.0 (I forget why, it seemed a good idea at the time), but now I find that Windows Update does not work - whenever I try to check the updates, it will fail with error code 8007000

  • Why is there a delay when I press Caps Lock shift before I can type

    Problem in typing and replacing letters without ceiling... the computer takes too long. When I type, and then press the f lock key my computer takes a few seconds before it works.  I tappe has about 90 OMP and it's very frustrating when I want to mak

  • Full access DHCP setting

    Hi, this is my first post here, please excuse if this is posted in the wrong forum, but how do I put my router (Cisco M10 V2) in full access DHCP. It is just go on the Basic Menu and Type of Internet connection and configuration in DHCP Auto - Config

  • Keep the white space with SAX parser?

    Is it possible to create a SAX parser that will result in white space and end forming part of the content of the element? SAX of RIM parser removes beginning and white space, even for documents that do not have DTD or schema. ("The Analyzer provides