Calculation of the percentage

Hi, I need help creating a calculation field that would be the percentage of the values obtained from the groups radio button in acrobat 9.0.

I have essentially ten groups radio button (ODIO1, ODIO2, ODIO3, ODIO4, ODIO5, ODIO6, ODIO7. ODIO8, ODIO9, ODI10).  They

each have six radio buttons/chocies that correspond to values of button of 0,1,2,3,4 and 5.

I need essentially a calculation field that displays the percentage of groups with the equation = (SUM(ODI01-ODI10)/50) * 100%.

It would give me a value from 0 to 100%.

I have little experience in the use of Javascript, so any help to the creation of a Javascript script to use this equation is greatly appreciated.

Thank you!

If you use a percentage field the result must be a number between 0 and 1, not 100...

In any case, copy the following code reproduces your formula:

var total = 0;

for (var i = 1; i)<=10;>

total += + (this.getField ("ODIO") + i) .value;

Event.Value = (total: 50) * 100;

Tags: Acrobat

Similar Questions

  • Calculation of the percentage of a certain point in time

    I'm figuring the success rate based on that ID has studied a particular UNIT.

    If I want to get the rate AFTER they studied their unit of PREP01

    Right now, the code below works fine, but it considers that all the units.

    1 ID looked a UNIT in 2010 before the PREP, if I do not want to look at it.

    Also studied FGT459 in 2011 SP 1 as well as their FIRST PREP unit in SP 1 so I DON'T want to consider. IF a DEVICE WAS MADE in THE SAME UNIT of TIME THE PREP01 I WANT to IGNORE IT.

    After the PREP unit, I want to review any unit that has the status as a GIFT. so on the 3 remaning units, they passed 1 and has no 3 so the percentage is 33.3%

    Right now my code gives me 66.7% coz I condier all units.

    Suffice it to consider after PREP has been studied (PRESENT) IF a UNIT AT the SAME TIME AS the PREP01 UNIT I WOULD IGNORE IT AS.

    Thanks for any help.

    The code I tried is:

    Select d1.id, ROUND (avg (case PASS_OR_BETTER

    When 'Y', 1

    0 otherwise

    (end) * 100,1) as Col.

    OF D1, D2 DAN_SPIL_GRADE DAN_SPIL_GRADE_IDS

    WHERE D1. RANK = D2. GRADE

    AND D1. STATE = 'PRESENT '.

    D1.id group

    TABLE1:


    CREATE TABLE DAN_SPIL_GRADE_IDS
    (VARCHAR2 (8) ID,)
    UNIT VARCHAR2 (8).
    STATUS VARCHAR2 (8).
    GRADE VARCHAR2 (12),
    VARCHAR2 (12) OF THE YEAR.
    PERIOD VARCHAR2 (12));

    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'FGT458', 'PRESENT', 'HD', ' 2010', "SP4");
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'FGT459', 'PRESENT', 'HD', ' 2011', "SP1");
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'PREP01', 'PRESENT', 'P', '2011', "SP1");
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'OPT878', 'AWAY', 'F', '2011', 'SP2');
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES (1 ', 'FRE111', 'PRESENT', ', ' 2011', 'SP3');
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'PREP02', 'PRESENT', 'F', '2012', "SP1");
    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD) VALUES ('1', 'PREP03', 'PRESENT', 'F', '2013', "SP4");

    IDUNITSTATUSGRADEYEARPERIOD
    1FGT458CURRENTLYHD2010SP4
    1FGT459CURRENTLYHD2011SP1
    1PREP01CURRENTLYP2011SP1
    1OPT878APSENTF2011SP2
    1FRE111CURRENTLYD2011SP3
    1PREP02CURRENTLYF2012SP1
    1PREP03CURRENTLYF2013SP4

    TABLE2


    CREATE TABLE DAN_SPIL_GRADE
    (RANK VARCHAR2 (8))
    PASS_OR_BETTER VARCHAR2 (12));

    INSERT INTO DAN_SPIL_GRADE (RANK, PASS_OR_BETTER) VALUES ('HD', 'Y');
    INSERT INTO DAN_SPIL_GRADE (RANK, PASS_OR_BETTER) VALUES (',' Y');
    INSERT INTO DAN_SPIL_GRADE (RANK, PASS_OR_BETTER) VALUES ('P', 'Y');
    INSERT INTO DAN_SPIL_GRADE (RANK, PASS_OR_BETTER) VALUES ('F', ' don't);

    GRADEPASS OR BETTER
    HDTHERE
    DTHERE
    PTHERE
    FN

    Gives:

    IDSUCCESS RATE
    166.7

    Here you are

    IDSUCCESS RATE
    133.3

    Hello

    A condition in a WHERE clause can cause an entire line is ignored.

    The same condition in a CASE expression can cause individual values is ignored, while keeping the line.

    You can modify the solution of knapen, remove the comparison of the unit_temp to 'PREP01' in the WHERE clause and put it in the expression BOX, like this:

    Select id

    tour

    (

    AVG

    (

    case

    When unit_temp = "PREP01" then NULL - compare here

    When pass_or_better = "Y" then 100

    0 otherwise

    end

    )

    1

    ) as Col.

    de)

    Select a.id

    a.unit

    b.pass_or_better

    a.year

    a.period

    , max (decode (unit, 'PREP01', 1, 0)) flag (partition by a.id stopped by year, period, unit)

    , max (unit) keep (dense_rank from first order to decode (unit, 'PREP01', 0, 1)) on unit_temp (partition by id, year, period)

    of dan_spil_grade_ids one

    Join dan_spil_grade b

    On a.grade = b.grade

    and a.status = 'PRESENT '.

    )

    where flag = 1

    - and unit_temp! = "PREP01" - not here

    Group

    by id;

    The display of your sample with this added line data:

    INSERT INTO DAN_SPIL_GRADE_IDS (ID, UNIT, STATUS, CATEGORY, YEAR, PERIOD)

    VALUES ('2', 'PREP01', 'PRESENT', 'F', '2012', 'SP3');

    is

    ID PASS

    -------- ----------

    1 33.3

    2

  • Calculation of the percentages of subqueries

    I got two sets of data - the total amount of renewable possible (IE sales last year) and the amount renewed (IE sales this year). What I need is a query that takes these two numbers and spits out the percentage renewed - (renewed / renewable) * 100. Complicated bit is I need to do this for each quarter - so I really need (sum (renewed) / sum (renewable)) * 100. The query below is my attempt to get the right numbers.

    The first select in the FROM statement below (with an alias as c) returns the total renewable for each quarter, as follows (the letters refer to specific products):
    Quarter          E                  S                  P                 F               Total
    First     339280.93     119124.45     713,588.08     37628.03     1,209,621.49
    Second     292568.55     101816.04     444,521.27     41894.42     880,800.28
    Third     460329.66     115907.42     452,387.62     66382.78     1,095,007.48
    Fourth     376677.66     112729.72     448,698.84     53152.44     991,258.66
    The second subselect in reports (with an alias like f) FROM total renewed for each quarter, as follows:
    Quarter          E                S                  P                 F                Total
    First     308735.15     82457.86     395,650.36     19520.87     806,364.24
    Second     109025.85     45634.73     113,095.45     20157.75     287,913.78
    Third     0.00          0.00     0.00     0.00     0.00
    Fourth     0.00     0.00     0.00     0.00     0.00
    When I run the query, I get four lines for each quarter, which is clearly not correct. For each quarter there are two rows which are all zeros, a line that has the correct percentages and the other with only garbage numbers.
    First                0.00                0.00                0.00                0.00                0.00
    First               91.00               69.22               55.45               51.88               66.66
    First               32.13               38.31               15.85               53.57               23.80
    First                0.00                0.00                0.00                0.00                0.00
    Second                0.00                0.00                0.00                0.00                0.00
    Second                0.00                0.00                0.00                0.00                0.00
    Second               37.27               44.82               25.44               48.12               32.69
    Second              105.53               80.99               89.01               46.60               91.55
    Third                0.00                0.00                0.00                0.00                0.00
    Third               67.07               71.14               87.46               29.41               73.64
    Third               23.68               39.37               25.00               30.37               26.29
    Third                0.00                0.00                0.00                0.00                0.00
    Fourth               28.94               40.48               25.21               37.92               29.05
    Fourth               81.96               73.15               88.18               36.73               81.35
    Fourth                0.00                0.00                0.00                0.00                0.00
    Fourth                0.00                0.00                0.00                0.00                0.00
    I tried to add the outermost Select, but then I can't understand a good group of. Any help on this would be appreciated, thanks.
    Select C.Quarter As Quarter_Name, 
           Round((F.E_Revenue / C.E_Revenue) * 100, 2) As E_Revenue,
           Round((F.S_Revenue / C.S_Revenue) * 100, 2) As S_Revenue,
           Round((F.P_Revenue / C.P_Revenue) * 100, 2) As P_Revenue,
           Round((F.F_Revenue / C.F_Revenue) * 100, 2) As F_Revenue,
           round((f.total_revenue / c.total_revenue) * 100, 2) as total_revenue, 
           c.sortcol as sortcol
        from 
            (SELECT DECODE(B.QUARTER_NAME, 1, 'First', 2, 'Second', 3, 'Third', 4, 'Fourth', 'Unknown') AS QUARTER, 
                   SUM(B.e_revenue) AS E_REVENUE, 
                   Sum(B.s_revenue) As S_Revenue, 
                   SUM(B.p_revenue) AS P_REVENUE, 
                   SUM(B.f_revenue) AS F_REVENUE, 
                   SUM(B.total_revenue) AS TOTAL_REVENUE, 
                   b.quarter_name as sortcol
                From
                     (Select mth.Quarter As Quarter_Name, 
                           Nvl((Select renewable_amt.Net_Revenue From renewable_amt Where renewable_amt.Product_Code = 'extended' And renewable_amt.Month_Id = A.Month_Id), 0) As e_revenue, 
                           Nvl((Select renewable_amt.Net_Revenue From renewable_amt Where renewable_amt.Product_Code = 'standard' And renewable_amt.Month_Id = A.Month_Id), 0) As s_revenue, 
                           Nvl((Select renewable_amt.Net_Revenue From renewable_amt Where renewable_amt.Product_Code = 'professional' And renewable_amt.Month_Id = A.Month_Id), 0) As p_revenue, 
                           Nvl((Select renewable_amt.Net_Revenue From renewable_amt Where renewable_amt.Product_Code = 'forecaster' And renewable_amt.Month_Id = A.Month_Id), 0) As f_revenue,
                           nvl((Select Sum(renewable_amt.Net_Revenue) From renewable_amt Where renewable_amt.Month_Id = A.Month_Id), 0) As total_revenue
                        FROM (SELECT DISTINCT renewable_amt.MONTH_ID FROM SMS.renewable_amt WHERE renewable_amt.FISCAL_YEAR = DECODE(EXTRACT(MONTH FROM TO_DATE(:H_P16_REPORTDT, 'DD-MON-YY')), 11, EXTRACT(YEAR FROM TO_DATE(:H_P16_REPORTDT, 'DD-MON-YY')) + 1, 12, EXTRACT(YEAR FROM TO_DATE(:H_P16_REPORTDT, 'DD-MON-YY')) + 1, EXTRACT(YEAR FROM TO_DATE(:H_P16_REPORTDT, 'DD-MON-YY')))) A, 
                             companyx.Month mth
                      Where mth.Month_Id = A.Month_Id) B
            GROUP BY B.QUARTER_NAME) c,
            (Select decode(e.Quarter_Name, 1, 'First', 2, 'Second', 3, 'Third', 4, 'Fourth', 'Unknown') as quarter, 
                   SUM(e.e_revenue) AS E_REVENUE, 
                   SUM(e.s_revenue) AS S_REVENUE, 
                   SUM(e.p_revenue) AS P_REVENUE, 
                   SUM(e.f_revenue) AS F_REVENUE, 
                   Sum(e.total_revenue) As Total_Revenue, 
                   e.quarter_name as sortcol
                from
                    (Select mth.quarter As quarter_Name, 
                           Nvl((Select renewed_amt.Renewed_Net From renewed_amt Where renewed_amt.Product_Code = 'extended' And renewed_amt.Month_Id = d.Month_Id And trunc(renewed_amt.report_dt) = :H_P16_REPORTDT), 0) As e_revenue, 
                           Nvl((Select renewed_amt.Renewed_Net From renewed_amt Where renewed_amt.Product_Code = 'standard' And renewed_amt.Month_Id = d.Month_Id And trunc(renewed_amt.report_dt) = :H_P16_REPORTDT), 0) As s_revenue, 
                           Nvl((Select renewed_amt.Renewed_Net From renewed_amt Where renewed_amt.Product_Code = 'professional' And renewed_amt.Month_Id = d.Month_Id And trunc(renewed_amt.report_dt) = :H_P16_REPORTDT), 0) As p_revenue, 
                           Nvl((Select renewed_amt.Renewed_Net From renewed_amt Where renewed_amt.Product_Code = 'forecaster' And renewed_amt.Month_Id = d.Month_Id And trunc(renewed_amt.report_dt) = :H_P16_REPORTDT), 0) As f_revenue,
                           nvl((Select sum(renewed_amt.renewed_net) From renewed_amt Where renewed_amt.Month_Id = d.Month_Id and trunc(renewed_amt.report_dt) = :H_P16_REPORTDT), 0) As total_revenue
                        From (Select Distinct renewed_amt.Month_Id From Sms.renewed_amt Where trunc(renewed_amt.report_dt) = :H_P16_REPORTDT) d, 
                             companyx.Month Mth
                      Where mth.Month_Id = d.Month_Id) e
            Group By E.Quarter_Name) F
    order by sortcol;       

    Hello

    It looks like you are a cross between c and e join.
    Shoudn't you have a join condition, something like that?

    ...               Where mth.Month_Id = d.Month_Id) e
            WHERE    c.quarter_name = e.quarter_name              -- Added
            Group By E.Quarter_Name) F
    order by sortcol;       
    

    If this does not resolve the problem, after a few examples of data (CREATE TABLE and INSERT statements) and the results desired from these data.

  • Calculation of the percentages of color

    I designed a floor of terrazzo using Freehand. My terrazzo contractor needs to know the percentage of each color, I used so it can order the right amount of material. Is there a feature that will show me what percentage of each color, I used for all the colors specified on my drawing?
    Thank you for all that help you can provide!

    > Is there a function that will show me what percentage of each color
    > I used for all the colors specified on my drawing?

    I don't know how to do that in FreeHand. However, if you have access to
    Illustrator, there is a free filter called PathArea.

    http://www.Telegraphics.com.au/SW/

    In artificial intelligence, use the magic wand tool to select all the paths with a fill color. The
    PathArea filter returns the total area. After recording manually areas,
    each color, it would be a simple matter to calculate the percentages.

    The filter for AI CS2 works in CS3. GOT CS3 will open most of the versions of
    FreeHand files.

    Judy Arndt

  • Calculation of the percentage formula Member

    I have a dimension of data type in an OSI application that is used to calculate adjustments to historical data. It is a dimension Label with only 3 members:

    Historical value

    Adj %

    Calculated Wo (dynamic member)

    Where I placed the following member formula in CalculatedAdj: CalculatedAdj = HistoricalValue * % Wo

    When validating the foregoing formula, I get the following error message "compilation error formula for [] (line 1): invalid assignment."

    I'm guessing that the formula is too simple and other parameters must be included, but I'm at a loss as to what they are. I appreciate your help.

    Hello f. Arabak

    If your synatax is exactly what you have written, then try this

    "CalculatedAdj" = "HistoricalValue" * "Wo % ';

    The special character needs quotation marks.

    He was missing the semicolon.

    Kind regards

    Philip Hulsebosch

  • the value according to the percentage split

    Hey suppose I have 2 columns in a table like this

    C1 c2
    __________
    20 200
    20
    40

    now I need a sql query that displays the output as

    C1 c2 c3
    ____________
    20 200 40
    20 40
    40 80

    that means I'm calculation of the percentages in column c1 c2 c3 column-based, can anyone help with the query

    I added the Group column. Without that there is no way to identify which c1 belongs to the cost of which c2.

    with pct_tbl as
    (select 1 grp, 20 c1, 200 c2 from dual union
    select 1 grp, 20, NULL from dual union
    select 1 grp, 60, NULL from dual union
    select 2 grp, 30, 300 from dual union
    select 2 grp, 30, NULL from dual union
    select 2 grp, 40, NULL from dual union
    select 3 grp, 10, 150 from dual union
    select 3 grp, 10, NULL from dual union
    select 3 grp, 30, NULL from dual)
    select grp, c1,c2,
    c1*first_value(c2) over (partition by grp order by grp,c2)/(sum(c1) over (partition by grp)) d
    from pct_tbl
    order by grp, c2 nulls last ;
    
           GRP         C1         C2          D
    ---------- ---------- ---------- ----------
             1         20        200         40
             1         20                    40
             1         60                   120
             2         30        300         90
             2         30                    90
             2         40                   120
             3         10        150         30
             3         10                    30
             3         30                    90
    

    Enjoy!
    Arpit

  • Question form: How to get the percentage calculated?

    Hello!

    I have a form that is a Bill as form. I can't get the front total tax, then plug the percentage tax amount (it varies depending on the County, so it cannot be a static number), then adding total before tax plus taxes. HOWEVER, I also need to know what total percentage tax is in the form of $.

    For example:

    BOX A - Total before taxes: $10.00 (calculated by the form of the total above form)

    BOX B - percentage of the tax: 10% (filled by the user)

    BOX C - Total AMOUNT: $ 11.00 (calculated from above)

    What I need too, is:

    BOX - total tax: $1

    Its final form:

    BOX A - Total before taxes: $10.00

    BOX B - percentage of the tax: 10%

    BOX C - total taxes: $1

    AREA D - Total AMOUNT: $ 11.00

    Thank you!

    Is box B a real percentage field, or is it just a body of numbers?

    If the first case, as the custom calculation of box C script enter:

    Event.Value = number (this.getField("Box_A").value) * number (this.getField("Box_B").value).

    If it's the latter, then copy the following code:

    Event.Value = number (this.getField("Box_A").value) * (number (this.getField("Box_B").value) / 100);

    Then set the calculation of the D box as being the sum of area A and area C.

  • Forms - calculation of percentages are based on the percentages of parent in a tree structure

    Hello

    We have a scenario where we build a tree using a standard package available in oracle forms when new block and fill a tree structure of multi Instance.

    The block is based on a single table.

    The tree is is filled. The problem is with the percentage calculations. As the percentage of the child dependent parent

    PERCENTAGE of PARENT- CHILD LEVEL

    1                101                       0                                 45

    1                102                      0                                  35

    1                103                      0                                   30

    2 201 101 PERCENTAGE OF PARENTS 101

    2 202 101 PERCENTAGE OF PARENTS 101

    2 203 102 PERCENTAGE OF PARENTS 102

    2 204 102 PERCENTAGE OF PARENTS 102

    3 301 201 PERCENTAGE OF PARENTS 201

    You can get the percentages to level 2, level 3.

    I was wondering how this can be done in oracle forms... for example... .to child 201, is the percentage of the 101 level... but level 101 is also filled in the buffer of the block as well as all Level1s...

    All entries are appreciated.

    Thanks and greetings

    S

    The solution me. Idea is to use the 'Post' at the time be called in a loop. Then POST will write in the validation of the database but strict.

    The idea is that at the time of execution, we would be able to select "Not ENGAGED" current session data in the database and use it more for treatment.

    Concerning

    S

  • Is it possible to implement or imitate the "percentage of parent row" feature, planned for PivotTables in obiee 11g, for a table of "normal"?

    Is it possible to set work/MIMC the "percentage of parent row" feature, planned for PivotTables in obiee 11g, for a table of "normal"?

    I'm able to calculate the percentage of parent row in "pivot table". but it's not getting displayed when I see him through graphic.

    Any way to calculate the "percentage of parent of the line" using the normal table and if I can use this column calculated on the chart. really appreciate your response.

    Thank you

    SAI.

    Hi Sai,

    You must be able to calculate the % using "SUM (measure at THE level [, level1, Middle])" to get the total of the top level of your line and to a share of the present value of the total (and * 100.0).

  • Need a Script to the space of images on a total gap, then tag each image with the percentage of the total image space

    By editing the other scripts, I found here and other sites (including the labels size rorohiko), I worked on a script that will each image with the dimensions of the label and calculate the percentage of the spread of everything (including the text, white space).

    Now, I was invited to a script that tagged the images with the percentage of total image on a gap space. This script is so space images on a total gap, then tag each image with the percentage of the total image space. For example if there is an image that is 10 x 10 inches and four pictures that are images of 2.5x2.5, 10 x 10 would be tagged with 50% and the 2.5x2.5 would be tagged with 12.5%.

    This is the script that does the percentage of total circulation. Can some clever person get to do what I need?

    Suze

    (Sorry, I don't know how to post the script here with line numbers!)

    //

    This script adds printing of information labels to each graphic image. The labels are on a separate layer

    named "PercentageLabels" so that all these added labels can be removed again by simply removing

    the layer.

    //

    If you move or resize items, simply re-run the script to update the labels.

    //

    Before (re) start the script, you can define a paragraph style "SizeLabelStyle".

    This style will apply to all content on labels.

    //

    Before (re) start the script, you can set a style of object 'SizeLabelObjectStyle '.

    This style of object apply to all executives of the label - so if you want a specific background

    fill out or frame, do it through this object style.

    //

    You can change the units of the size label. I put in inches. Change the line below that has

    kUnitToUse - you can use:

    MeasurementUnits.CENTIMETERS

    MeasurementUnits.CICERO

    MeasurementUnits.INCHES

    MeasurementUnits.MILLIMETERS

    MeasurementUnits.PICAS

    MeasurementUnits.PIXELS

    MeasurementUnits.POINTS

    //

    By default the script will not attempt to label the "nested" images If you also want to label

    nested images (for example inline images, anchored frames, pasted images in the images,...) to change the line

    below to read:

    kLabelNestedItems = 1

    //

    If you want a specific image to stay without a label, you can use the Script label palette for

    assign a script called 'ignore' for this frame. The script will then not label this framework to the

    the title of the script is removed again.

    //

    Change the lines with kDontLabelImageFrames, kDontLabelTextFrames, kDontLabelOtherFrames

    below if you want to restrict labelling to only certain types of images: replace the '0'

    in "1" to enable these options.

    //

    Change the line with kShowImageFileName if you also want to display the names of the image in the

    size for the picture frames.

    //

    Small frames are not labelled - the cutoff point is currently a less than 0.1 inch high framework

    or 0.1 inch wide. You can change the cutoff point by adjusting the lines with kDontLabelBelowWidth

    or kDontLabelBelowHeight below.

    //

    var Girard;

    var gScriptFile;

    var gCaches;

    // ****************

    That's cheating spread automatically calculated

    var doc = app.activeDocument;

    doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.inches;

    doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.inches;

    PageWidth = doc.documentPreferences.pageWidth var;

    stucture var pagewidth = * 2;

    var spreadheight = doc.documentPreferences.pageHeight;

    var spreadsquinch = stucture * spreadheight;

    Alert ("the total measure of square inch of spread is:" + spreadsquinch);

    //******************

    VR;

    {

    If (app.activeScript instanceof file)

    {

    var gScriptFile = app.activeScript;

    }

    }

    catch (Girard)

    {

    }

    If (typeof (kLogLevel) is "undefined")

    {

    const kLogLevel = 5;

    const kMaxLogNestLevel = 5;

    const kLogToMessageBox = 0;

    const kLogToConsole = 0;

    const kLogToFile = 0;

    const kLogFileName = "PercentageLabels.log";

    const kIgnoreFrameLabel = "ignore."

    const kSizeLabelLayerName = "PercentageLabels";

    const kLabelNestedItems = 0;

    const kDontLabelImageFrames = 0;

    const kDontLabelTextFrames = 1;

    const kDontLabelOtherFrames = 0;

    const kUnitToUse = MeasurementUnits.INCHES;

    const kShowImageFileName = 0; This set to 1 to precede the name of the image file in the tag

    Below all of the measures are expressed in kUnitToUse (e.g. inches if MeasurementUnits.INCHES is used)

    const kRoundToDecimals = 2;

    The separator to use between objects - for example MyImage.jpg - 7.22 x 9,34

    const kSeparatorBetweenNameAndSize = "-";

    const kSeparatorBetweenHeightAndWidth = "H x"; "

    const kSeparatorAfterWidth = "W";

    const kDontLabelBelowWidth = 0.1; In kUnitToUse

    const kDontLabelBelowHeight = 0.1; In kUnitToUse

    const kLabelStyleName = "SizeLabelStyle";

    const kLabelObjectStyleName = "SizeLabelObjectStyle";

    const kLabelHeight = 0.6; In kUnitToUse

    const kLabelWidth = 2.5; Expressed in kUnitToUse (e.g., inches).

    }

    var gRunState =

    {

    logToMessageBox: kLogToMessageBox,

    logToConsole: kLogToConsole,.

    logToFile: kLogToFile,.

    functionNestLevel: 0,

    logFunctionEntry: true,

    logFunctionExit: true,

    logLevel: kLogLevel,.

    logFileName: kLogFileName

    };

    Main();

    // ****************

    function ConvertToFrame (thePageItem)

    {

    / * / / / LogEntry ("ConvertToFrame");

    var retVal = thePageItem.getElements () [0];

    / * / / / LogExit ("ConvertToFrame");

    Return retVal;

    }

    // ****************

    function CollectionToArray (theCollection)

    {

    / * / / / LogEntry ("CollectionToArray");

    var retVal = theCollection.everyItem () .getElements () .slice (0);

    / * / / / LogExit ("CollectionToArray");

    Return retVal;

    }

    // ****************

    function GetImageFile (pageItem)

    {

    / * / / / LogEntry ("GetImageFile");

    var imageFile = null;

    do

    {

    Try

    {

    pageItem = ConvertToFrame (pageItem);

    If (!) (("allGraphics" in pageItem))

    {

    break;

    }

    var allGraphics = pageItem.allGraphics.slice (0);

    If (allGraphics.length == 0)

    {

    break;

    }

    var chart = allGraphics [0];

    var graphic.itemLink = link;

    imageFile = new File (link.filePath);

    }

    catch (Girard)

    {

    }

    }

    While (false);

    / * / / / LogExit ("GetImageFile");

    return imageFile.

    }

    // ****************

    function GetImageName (pageItem)

    {

    / * / / / LogEntry ("GetImageName");

    var imageName = "";

    do

    {

    var imageFile = GetImageFile (pageItem);

    If (imageFile is nothing)

    {

    break;

    }

    imageName = imageFile.displayName;

    }

    While (false);

    / * / / / LogExit ("GetImageName");

    return imageName;

    }

    // ****************

    function GetOuterPageItem (pageItem)

    {

    / * / / / LogEntry ("GetOuterPageItem");

    var retVal = null;

    do

    {

    Try

    {

    retVal = pageItem.parent;

    If (retVal instanceof spread | retVal instanceof Page)

    {

    retVal = pageItem;

    break;

    }

    If (retVal instanceof character)

    {

    retVal = GetOuterPageItem(retVal.parentTextFrames[0]);

    break;

    }

    }

    catch (Girard)

    {

    retVal = null;

    }

    }

    While (false);

    / * / / / LogExit ("GetOuterPageItem");

    Return retVal;

    }

    // ****************

    function LogMessage (message, collapseLines)

    {

    If (gRunState.logToConsole)

    {

    $.writeln (message);

    }

    If (gRunState.logToFile)

    {

    var logFile = new file (gScriptFile.parent + "/" + gRunState.logFileName);

    var now = new Date();

    logFile.open ("a");

    logFile.write (now.toString () + ":"+ message + "\n" ');

    logFile.close ();

    }

    If (gRunState.logToMessageBox)

    {

    Alert (message);

    }

    }

    // ****************

    LogEntry (message) function

    {

    If (gRunState.logFunctionEntry)

    {

    If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

    for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

    {

    message = "" + message;

    }

    Filled (message + "<", true);

    }

    }

    gRunState.functionNestLevel ++;

    }

    // ****************

    function LogError (message)

    {

    If (gRunState.logLevel > = 1).

    {

    LogMessage ("* ERROR *:" + message, false);

    }

    }

    // ****************

    function LogExit (message)

    {

    -gRunState.functionNestLevel;

    If (gRunState.functionNestLevel < 0)

    {

    LogError ("LogExit: unbalanced nesting of function");

    }

    If (gRunState.logFunctionExit)

    {

    If (gRunState.functionNestLevel < kMaxLogNestLevel) {}

    for (var idx = 0; idx < gRunState.functionNestLevel; idx ++)

    {

    message = "" + message;

    }

    Filled (message + ">", true);

    }

    }

    }

    // ****************

    function LogNote (message)

    {

    If (gRunState.logLevel > = 3)

    {

    LogMessage ("Note:" + message, false);

    }

    }

    // ****************

    function LogWarning (message)

    {

    If (gRunState.logLevel > = 2)

    {

    LogMessage ("WARNING:" + message, false);

    }

    }

    // ****************

    function Main()

    {

    / * / / / LogEntry ("Main");

    var savedUserInteractionLevel = app.scriptPreferences.userInteractionLevel;

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

    do

    {

    Try

    {

    activeDocument var = app.activeDocument;

    If (!.) (activeDocument instanceof Document))

    {

    LogError ("hand: activeDocument isn't a Document");

    break;

    }

    var savedHorizontalMeasurementUnits = activeDocument.viewPreferences.horizontalMeasurementUnits;

    activeDocument.viewPreferences.horizontalMeasurementUnits = kUnitToUse;

    var savedVerticalMeasurementUnits = activeDocument.viewPreferences.verticalMeasurementUnits;

    activeDocument.viewPreferences.verticalMeasurementUnits = kUnitToUse;

    var savedRulerOrigin = activeDocument.viewPreferences.rulerOrigin;

    activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

    do

    {

    Try

    {

    ProcessFrames (activeDocument);

    }

    catch (Girard)

    {

    Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

    }

    }

    While (false);

    activeDocument.viewPreferences.rulerOrigin = savedRulerOrigin;

    activeDocument.viewPreferences.horizontalMeasurementUnits = savedHorizontalMeasurementUnits;

    activeDocument.viewPreferences.verticalMeasurementUnits = savedVerticalMeasurementUnits;

    }

    catch (Girard)

    {

    Alert ("the script encountered a situation that we don't know how to handle. "He received the error, says '" + Parker + "' in Main()"); "."

    LogError ("Hand throw" + Girard);

    }

    }

    While (false);

    app.scriptPreferences.userInteractionLevel = savedUserInteractionLevel;

    / * / / / LogExit ("Main");

    }

    // ****************

    function ProcessFrames (doc)

    {

    / * / / / LogEntry ("ProcessFrames");

    var err;

    do

    {

    If (!.) (doc instanceof Document))

    {

    LogError ("ProcessFrames: doc should be a Document");

    break;

    }

    Try

    {

    var existingLayer = doc.layers.itemByName (kSizeLabelLayerName);

    existingLayer.id;

    existingLayer.remove ();

    }

    catch (err)

    {

    }

    If (kLabelNestedItems)

    {

    var pageItems = doc.allPageItems.slice (0);

    }

    on the other

    {

    var pageItems = CollectionToArray (doc.pageItems);

    }

    var frameReferences = [];

    for (var pageItemIdx = 0; pageItemIdx < pageItems.length; pageItemIdx ++)

    {

    do

    {

    var pageItem = pageItems [pageItemIdx];

    If (pageItem.itemLayer.name is kSizeLabelLayerName)

    {

    break;

    }

    var pageItem = ConvertToFrame (pageItem);

    If (instanceof TextFrame pageItem)

    {

    If (kDontLabelTextFrames)

    {

    break;

    }

    }

    ElseIf (pageItem graphic instanceof)

    {

    If (kDontLabelImageFrames)

    {

    break;

    }

    }

    on the other

    {

    If (kDontLabelOtherFrames)

    {

    break;

    }

    }

    If (pageItem.label.toLowerCase () is kIgnoreFrameLabel)

    {

    break;

    }

    var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

    var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

    If (width < kDontLabelBelowWidth)

    {

    break;

    }

    If (height, kDontLabelBelowHeight)

    {

    break;

    }

    frameReferences.push (pageItem);

    }

    While (false);

    }

    var sizeLabelLayer = doc.layers.add ({name: kSizeLabelLayerName});

    for (var pageItemIdx = 0; pageItemIdx < frameReferences.length; pageItemIdx ++)

    {

    Try

    {

    var pageItem = frameReferences [pageItemIdx];

    var width = pageItem.geometricBounds [3] - pageItem.geometricBounds [1];

    var height = pageItem.geometricBounds [2] - pageItem.geometricBounds [0];

    var labelItem = doc.textFrames.add (null, LocationOptions.BEFORE, GetOuterPageItem (pageItem));

    labelItem.itemLayer = sizeLabelLayer;

    var boxsquinch = width * height

    var boxpercent = (boxsquinch / spreadsquinch) * 100

    var roundpercent = Math.round (boxpercent)

    var labelText = "";

    If (kShowImageFileName)

    {

    var imageName = GetImageName (pageItem);

    If (imageName! = "")

    {

    labelText += imageName + kSeparatorBetweenNameAndSize;

    }

    }

    labelText += RoundString (height, kRoundToDecimals) + kSeparatorBetweenHeightAndWidth + RoundString(width, kRoundToDecimals) + kSeparatorAfterWidth + ' \r\n'+ roundpercent + '% ';

    labelItem.contents = labelText;

    xPos = pageItem.geometricBounds var [1];

    yPos = pageItem.geometricBounds var [0] + kLabelHeight;

    labelItem.geometricBounds is [Posy, xPos, yPos + kLabelHeight, xPos + kLabelWidth];.

    Try

    {

    labelItem.parentStory.characters.everyItem () .appliedCharacterStyle = doc.characterStyles.item (0);

    }

    catch (err)

    {

    }

    Try

    {

    labelItem.parentStory.paragraphs.everyItem () .appliedParagraphStyle = kLabelStyleName;

    }

    catch (err)

    {

    }

    Try

    {

    labelItem.appliedObjectStyle = doc.objectStyles.itemByName (kLabelObjectStyleName);

    }

    catch (err)

    {

    }

    }

    catch (err)

    {

    }

    }

    }

    While (false);

    / * / / / LogExit ("ProcessFrames");

    }

    // ****************

    function RoundString (numVal, decimal)

    {

    / * / / / LogEntry ("Round");

    var retVal = Math.round (numVal * Math.pow(10,decimals)) + "";

    retVal = retVal.substring(0,retVal.length-decimals) + "." + retVal.substring(retVal.length-decimals);

    / * / / / LogExit ("Round");

    Return retVal;

    }

    What do you mean?

    var myDoc = app.activeDocument;
    var mySpreads = myDoc.spreads;
    var myRectangles = myDoc.rectangles;
    var myImages = 0;
    for (var i = 0; i < mySpreads.length; i++) {
        var mySpreadWidth = 0;
        var mySpreadHeight = myDoc.documentPreferences.pageHeight;
        for (var j = 0; j < mySpreads[i].pages.length; j++) {
            mySpreadWidth += myDoc.documentPreferences.pageWidth;
            }
        var mySpreadArea = mySpreadWidth * mySpreadHeight;
        var myImages = mySpreads[i].rectangles;
        var myTotalImageArea = 0;
        var myIndividualImageArea = [];
        for (var j = 0; j < myImages.length; j++) {
            var myImageGeometricBounds = myImages[j].geometricBounds;
            var myImageWidth = myImageGeometricBounds[3] - myImageGeometricBounds[1];
            var myImageHeight = myImageGeometricBounds[2] - myImageGeometricBounds[0];
            myIndividualImageArea[j] = (myImageWidth * myImageHeight);
            myTotalImageArea += myIndividualImageArea[j];
            }
        for (var j = 0; j < myIndividualImageArea.length; j++) {
            alert("Image percentage of total images on spread " + (i + 1) + " = " + (myIndividualImageArea[j] * 100) /myTotalImageArea);
            }
       alert("Total image percentage on spread " + (i + 1) + " = " + myTotalImageArea);
       }
    
  • Control of the expression / Slider control works with the percentage?

    For example, I want to do something with keyframes, so opted to use "regulator toslide ," but is now defined by the "cursor", if I put the wiggleexpression (2.5) and place 2 on the regulator to behind the scenes, knowing that the value will be replaced by the value of "slider" so in the case of the control slide was "10". , would look like this: wiggle (10.5)

    But I want to know is if the control of the expression of origin by a percentage and not a replaced, for the value of the slider control.

    Thank you!

    If the amount of your max value is set, then by creating the cursor to drive the percentage of this number requires a few simple calculations.

    Degree of accuracy desired percentage to be hover would require a small change that in mathematics.

    This example allows you to animate a percentage of '2' frequency (maximum value) in agitation, but allows the range '5 ': stay

    mV = 2; maximum value

    PERC = (effect ("Slider Control")("Slider")/100);  makes a percentage since the slider value by using 0-100

    Wiggle(MV*PERC,5)

    explanation:

    There are several ways to do so.

    The slider is unlimited, so you can define OTHER rules in your expression, but to keep it simple:

    You must multiply your maximum value of your "perc."

    However, we want to transform the number 'perc' in a fraction.

    A simple way is to divide the amount of cursor by 100.

    Multiply your max value with the result of your cursor (/ 100) and you have your percentage.

    (* You can use fractional numbers to animate instead of this, but the cursor is easier to control in this way.)

  • calculation in the PivotTable field

    Hi all, in obiee answer in PivotTable when calculating the percentage of the Total row, it shows 1.0. Is there a way to show 0.3 in this cell and see the rest line adding the values in the table?

    Cat Total percentage value

    A              8        10           0.8

    B             10       50           0.2

    18 60 1.0 total

    View you want:

    Cat Total percentage value

    A         8        10           0.8

    B         10       50           0.2

    18 60 0.3 total

    Thanks, Sushil

    Try this for your percentage formula.

    (SUM(Value 1) /SOMME (CAST (DOUBLE value 2))) * 100

  • How to add the percentage symbol (%) at the end of a number in a form field

    Hello

    I need to display a percentage as a result of a calculation in the form: 80.23%
    How can I run the Format mask within a shape of the APEX to show that?

    I use a PL/SQL expression


    Thank you

    Hello

    How about if you add to item after item text

    <span>%</span>
    

    Kind regards
    Jari

  • Result in calculation display with percentage sign

    I'm using FormCalc to sum a column of

    values of drop-down lists, and then multiply the number of points divided by 100 times. The calculation works fine, but I'd like a percent sign (%) to appear in the field where calculation is after the calculated number. The number appeared, I just can't figure out how to get the percentage symbol to display.

    Thank you

    MDawn

    Hello

    You can set it in the object > field tab, by selecting models.

    In the view tab, select the percentage.

    If you want to define the number of digits after the decimal point, then, you can use a general model of number and then add '%' in the braces.

    Hope that helps,

    Niall

    ... break...

  • Round the percentage to a whole number

    Hello

    I'm still pretty new to perform calculations of script and thereby an individual seems a bit more complex for me.

    I am trying to determine the difference in percentage between 2 numbers and display the percentage as a whole number. Logically my calculation looks like

    (numericField1 - numericField2 / numericField1 * 100)
    (e.g. 1000-850 / 1000 * 100 = 15%)

    I need help with my math and especially round the % to an integer. I wouldn't have all of the answers posted as 22.66666%

    The code below is somethig I tried

    Event.Value = roundNumber ((this.getField (numericField1) .value - this.getField ("numericField2t") .value) / this.getField (numericField1) .value, 2) + "%";

    function roundNumber (num, dec) {}
    var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec;)
    return the result;

    Any advice would be great!

    Adobe is actually this really simple for you.  If you use a numeric field to display the result, the display for the field template will control the way number.  You can set a percentage pattern:"num{zzzz9.99%}" to control how many digits will be displayed, and how many digits will be important beyond the decimal point.  If there is more than numbers, Adobe will automatically complement number.  In the attached example, I used the boss

    "{zzzz9 %} num" to ensure that only a whole number will be displayed.  Adobe uses the normal rounding rules: 0-4 rounds down, 5 to 9 rounds.

    In addition, the percentage will automatically multiply the value in the field by 100, so you don't need to do it in your script.

    For the attached example, I added your script FormCalc calculation to Calculate the result field event.  The script is now simply:

    (NumericField1 - NumericField2) / NumericField1

    Adobe takes care of the rest.

Maybe you are looking for

  • Is there anything I can recognize what image runs in the plate sequence?

    Hi all I would like to know if there is a way I can recognize what image is running in the plate sequence? If I have five images in the sequence of flat, I want to keep track of each image in the façade visually. I use LV8.2 Thanks in advance for you

  • Writing in excel

    Hello I would like to write several files text that have the same layout table following each other in one excel spreadsheet using ActiveX, but I can't seem to find the methods and/or properties that it takes, no other method or property which return

  • my external hd will not appear in my computer, it is in the device driver and says working ok

    my external hd will not appear in my computer.  It is in the device driver and work very well, and it shows in the hard drives and says working properly.      I turn it on then it is not in my pc so that I can usr it t / you rick * address email is r

  • PLEASE HELP WHAT I DO? WINDOWS DEFENDER

    My windows Defender encountered an error: 0x800106ba. A problem caused to stop this service programs. To start the service, restart your computer or search help and SUpport to find out how to start a service manually.  So I pressed OK and then anothe

  • Computer running slow / CPU shows very high %

    Why my laptop run very slow and lagging behind, the CPU show % very high and unstable at all without opening anything. and he delay my departure until the time of the computer.