Delete zero balances in calculated fields and zero decimal points

Hello

I found the right java script to remove the balances of zero in calculated fields, but also, so I have to remove the two decimal points.  Can I work on what I need to add and where in java script so that it works?

Thank you

Nicole

If you don't want to show any decimal places, this means generally that you want to round down to an integer. To round to the nearest integer, you could modify a single line of script in the Format:

AFNumber_Format (0, 0, 0, 0, "$", true);

and the same for the script of the hit. Note that this does not change the actual value of the field, it doesn't change what is displayed in the field. This is important if the value of the field is used in a calculation or exported, since it won't be the same as what is displayed. To change the value of actual field to round to an integer, it is usually best to use a custom validation script.

Tags: Acrobat

Similar Questions

  • deletion of data of calculated field

    Hello

    I was just curious if there was a way to remove the data that has been calculated, while allowing a user to enter data in the text field.  For example some textbox control gets filled with 'Hello' If this another check box is selected, but then if I had an 'else event.value = ''; ' to remove the data on the box is not checked, then it does not the user to enter manually from the data in some text box, because when he came, it is removed immediately because the other checkbox is disabled.

    Any help would be great

    See if the following calculation for the text field script does it behave as you want:

    Get a reference to the box

    var f = getField ("alt holidays");

    If the checkbox change triggered this script...

    If (event.source & event.source = f) {}

    .. .set this text field value and make read-only if the check box is selected.

    If (f.value! == 'Off') {}

    Event.Value = "vacation alternating;

    Event.Target.ReadOnly = true;

    .. otherwise clear this text field and make it editable

    } else {}

    Event.Value = "";

    Event.Target.ReadOnly = false;

    }

    }

    The text field that is attached to this script will not get cleaned up if its calculation is triggered by a change in value of any domain other than the check box field, including the text field itself. In other words, it is crossed by the script at the same time the checkbox is disabled.

    The advantage of doing it this way, as opposed using the mouse event to the top of the box, the script will be executed if the value of the checkbox is set programmatically or by importing a data file.

  • 0 and the decimal point in Oracle SQL

    Hello


    IM using Oracle Sql developer 'Oracle Database 11g Enterprise Edition Release 11.1.0.6.0' (I'm fairly new), im having trouble inserting '0 before 1' in the table, as well as with the decimal point
    I created a table with the following:

    CREATE TABLE employee
    (Employe_id number (4,0) NOT NULL primary key,)
    L_Name varchar2 (15).
    What varchar2 (10),
    Number of Pay_Rate (5);

    Then tried to insert this: insert into employee
    values ('003', 'Clarke', 'Michael', '13 h 00');
    which has been a success, but when I used the query select it to display the table, the result was not the same

    result:
    Employee_id L_Name what Pay_Rate
    1 13 Michael Clarke


    How can I ensure that the result looks like this (001 and 13 h 00):
    Employee_id L_Name what Pay_Rate
    001 Micheal Clarke 13.00

    Edited by: 936867 may 25, 2012 20:15

    Edited by: 936867 may 25, 2012 20:18

    936867 wrote:
    Sorry, I wanted to ask "what needs to be changed in the create table statement, so when I introduced through the 'Insert into' data is presented as above after the select query. I want the data to show as entered when I look at the table, I know that can use the select query to display data in the desired format.

    Then do not define the columns as a NUMBER, but as strings of VARCHAR2,
    but realize that you can't do arithmetic on strings.

    NUMBERS have no beginning or ending zeros but bites can contain what you want.

  • Have calculated fields appear white instead of zero

    So I have a calculated field 'Price Total 1', which is the product of the "number 1" and "price unit 1".»» Unit price and Total are the currency and quantity is a number. I put in a script validation as follows:

    if(event.value == 0) event.value = '';
    
    

    He strives to remove zeros when the pdf file is loading, but I have another question later. As I begin to fill in the values, updated with zeros, I didn't want to appear. An example is provided:

    test.png

    I want prices Total remains empty until the quantity and unit price are filled. And of course, I don't want Total price 2, 3, 4, etc. to have zeros happen when they are not met.

    There's your problem... Chrome uses its own internal PDF Viewer that has

    problems with it comes to scripts and form fields. Do not open the

    in Explorer but save and open in the local application

    instead.

    Tuesday, December 15, 2015 at 10:38, michaely82099405 [email protected]

  • How can I get rid of zero in a calculated field when the form is empty?

    I made a form that prompts the user to enter data for specific years.  At the top of the form, the user places in the current year, i.e. 2000.  Column copy this year here, the second column adds five years and the third column adds 10 years.  I managed to create a simple script for each of these columns (so that when 2000 came; columns a, b, and c appear as 2000, 2005 and 2010) but when the form is empty a zero appears in the first cell, a 5 appears in the second cell and a 10 appears in the third cell.  I want the completely empty form so as to not confuse the person when they begin to enter data.  How can I write a custom script to eliminate the numbers in calculated fields?

    I would use a script for calculating customized for each of these fields. Something like:

    Calculation for reference year script

    (function () {}

    Get the value of the WCPYear field

    var v = getField("WPCYear").valueAsString;

    Set the value of this field. The value empty if WCPYear is empty

    Event.Value = v? v : "";

    })();

    Calculation script for field goal 5 years

    (function () {}

    Get the value of the WCPYear field

    var v = getField("WPCYear").valueAsString;

    Set the value of this field. The value empty if WCPYear is empty

    Event.Value = v? +v + 5 : "";

    })();

    Calculation script for the 10-year target field

    (function () {}

    Get the value of the WCPYear field

    var v = getField("WPCYear").valueAsString;

    Set the value of this field. The value empty if WCPYear is empty

    Event.Value = v? + v + 10 : « » ;

    })();

  • How can I create a PDF form that contains data fields and calculated fields?

    Hello, I need to create PDF forms that has

    -Fields that are read from a MS SQL Server database, once the user enters a field other fields must be read from an underlying database

    -Calculated fields

    what PDF forms product supports this? Once this file created is also filling end-user which form has any kind of special licenses, otherwise he will be able to fill this with Adobe Reader?

    You need to expand the PDF form using Adobe LiveCycle Designer if you want to be able to connect to a database.

    And Yes, it should be possible to use the file in Adobe Reader after that.

    For more questions on LCD forms are trying this forum: LiveCycle Designer

  • I can cause a ticking a box to add 1 to a calculated field?  I have a field that summarizes the numbers entered in several previous fields and must be able to add '1' If a checkbox is enabled as well.

    I can cause a ticking a box to add 1 to a calculated field?  I have a field that summarizes the numbers entered in several previous fields and must be able to add '1' If a checkbox is enabled as well.

    My first sample: If all the checked Checkbox event.value wins 1

    My next sample: If one of the boxes is enabled event.value wins 1

    Event.Value =

    this.getField ("Check Box16") .isBoxChecked (0) |

    this.getField ("Check Box17") .isBoxChecked (0) |

    this.getField ("Check Box18") .isBoxChecked (0) |

    this.getField ("Check Box19") .isBoxChecked (0) |

    this.getField ("Check Box20") .isBoxChecked (0)

  • Help me remove the zeros and add the decimal point using Expression GREP

    Hello, I have a few numbers... A few thousand to be exact I need to drop some zeros and add a dollar sign and the decimal representing the cents, how can I do it using GREP Expression. An example of the number would be: 000000000396465 or 000000000044813, it will be always 15 characters, I would like that to be converted to this:

    $3964,65

    $448,13

    Thank you

    Use Adobe CS5 on Mac

    Great, it worked! You just saved me weeks of work.

    Thank you

  • The hidden fields and deleted context

    I created a form with text fields that are visible or hidden depending on the selections that you made in the previous two menu drop-down lists. The user of the form has fields of different type based on their choice text. The problem I have is that I want only to preserve the content of the visible field and do want the contents of the visible field to be saved in the XML of the .csv file. In other words - if they make another choice in the drop-down lists to "activate" the different text fields - the text in the previously visible text fields would be deleted. I'm sure that logic has something to do with "If presence = hidden, then value = null", but I'm completely new scripting in LiveCycle and don't have no idea how to write this.

    I don't see a way to view a PDF file, but I inserted my code below.

    ----- form1.#subform[0].VariableLocation::exit: - (JavaScript, client) -----------------------------
    
    //Clear out the StaticLocation DropDown list
    StaticLocation.rawValue = "";
    StaticLocation.clearItems();
    
    
    switch (this.rawValue)
    {
    case "Top Center  ":
    StaticLocation.addItem("Lower Right");
    StaticLocation.addItem("None");
    break;
    
    case "Lower Right":
    StaticLocation.addItem("Top Center  ");
    StaticLocation.addItem("None");
    break;
    
    case "Top Center":
    StaticLocation.addItem("Lower Left");
    StaticLocation.addItem("None");
    break;
    
    case "Lower Left":
    StaticLocation.addItem("Top Center");
    StaticLocation.addItem("None");
    break;
    }
    
    
    
    //TextFields 1a-4a
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1a.presence = "visible"; 
    }
    else
    {
         TextField1a.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2a.presence = "visible"; 
    }
    else
    {
         TextField2a.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3a.presence = "visible"; 
    }
    else
    {
         TextField3a.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4a.presence = "visible"; 
    }
    else
    {
         TextField4a.presence = "hidden"; 
    }
    
    
    
    //TextFields 1b-4b
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1b.presence = "visible"; 
    }
    else
    {
         TextField1b.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2b.presence = "visible"; 
    }
    else
    {
         TextField2b.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3b.presence = "visible"; 
    }
    else
    {
         TextField3b.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4b.presence = "visible"; 
    }
    else
    {
         TextField4b.presence = "hidden"; 
    }
    
    
    
    
    
    //TextFields 1c-4c
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1c.presence = "visible"; 
    }
    else
    {
         TextField1c.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2c.presence = "visible"; 
    }
    else
    {
         TextField2c.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3c.presence = "visible"; 
    }
    else
    {
         TextField3c.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4c.presence = "visible"; 
    }
    else
    {
         TextField4c.presence = "hidden"; 
    }
    
    
    
    
    
    //TextFields 1d-4d
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1d.presence = "visible"; 
    }
    else
    {
         TextField1d.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2d.presence = "visible"; 
    }
    else
    {
         TextField2d.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3d.presence = "visible"; 
    }
    else
    {
         TextField3d.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4d.presence = "visible"; 
    }
    else
    {
         TextField4d.presence = "hidden"; 
    }
    
    
    
    
    //TextFields 1e-4e
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1e.presence = "visible"; 
    }
    else
    {
         TextField1e.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2e.presence = "visible"; 
    }
    else
    {
         TextField2e.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3e.presence = "visible"; 
    }
    else
    {
         TextField3e.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4e.presence = "visible"; 
    }
    else
    {
         TextField4e.presence = "hidden"; 
    }
    
    
    
    
    
    //TextFields 1f-4f
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1f.presence = "visible"; 
    }
    else
    {
         TextField1f.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2f.presence = "visible"; 
    }
    else
    {
         TextField2f.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3f.presence = "visible"; 
    }
    else
    {
         TextField3f.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4f.presence = "visible"; 
    }
    else
    {
         TextField4f.presence = "hidden"; 
    }
    
    
    
    
    
    
    //TextFields 1g-4g
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1g.presence = "visible"; 
    }
    else
    {
         TextField1g.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2g.presence = "visible"; 
    }
    else
    {
         TextField2g.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3g.presence = "visible"; 
    }
    else
    {
         TextField3g.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4g.presence = "visible"; 
    }
    else
    {
         TextField4g.presence = "hidden"; 
    }
    
    
    
    
    
    
    
    //TextFields 1h-4h
    
    
    if (this.rawValue == "Top Center")
    {
         TextField1h.presence = "visible"; 
    }
    else
    {
         TextField1h.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField2h.presence = "visible"; 
    }
    else
    {
         TextField2h.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField3h.presence = "visible"; 
    }
    else
    {
         TextField3h.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField4h.presence = "visible"; 
    }
    else
    {
         TextField4h.presence = "hidden"; 
    }
    
    
    
    
    //TextFields 1i-4i
    
    
    if (this.rawValue == "Top Center")
    {
         TextField2i.presence = "visible"; 
    }
    else
    {
         TextField2i.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Left")
    {
         TextField1i.presence = "visible"; 
    }
    else
    {
         TextField1i.presence = "hidden"; 
    }
    
    if (this.rawValue == "Top Center  ")
    {
         TextField4i.presence = "visible"; 
    }
    else
    {
         TextField4i.presence = "hidden"; 
    }
    
    if (this.rawValue == "Lower Right")
    {
         TextField3i.presence = "visible"; 
    }
    else
    {
         TextField3i.presence = "hidden"; 
    }
     
    
    

    .

    Yes

  • How to reset the Status field and delete ToDo list outside the user interface?

    All, morning

    HR 802 generating WebHelp.

    I made use of the status field and ToDo List in the past. For my next release aid, I would like to reset these fields for all the subjects, so I can still have accurate reports as subjects of creation/revision of the final course.

    Is it possible to do without opening each topic in the user interface and compensation/change manual fields? (I thought to delete all fields of ToDo and recreate them, but thought that there is an easier way.) This information appears in each section or in a separate file?

    Thank you

    Patrick

    Hi Patrick

    1. Close all topics that can be opened in the editor.
    2. Open the pod of the list of topics.
    3. Select all subjects.
    4. Right-click and choose Properties from the subject.
    5. Click the status tab.
    6. Modify if needed.

    All subjects should change to reflect the new status and the task list settings.

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7 or 8 days - $24.95!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Query on calculated field where deletes conditions of the clause

    Hi gurus,

    Under a new requirement, we have created a new field calculated in Contact before JC, which removes the condition from which to extract the clause and made full table.

    Requirement:

    We have a field in the user interface, that has data like "J1234" or "K44335". Customer won't see the first character of the alphabet of these data.

    Solution, we have developed:

    (1) create a new calculated field 'ABC person UId Calc' as follows.

    Name: ABC person UId Calc
    Calculated: true
    Computed value: right ([nobody UId], Len([Person UId]) - 1).

    (2) exposed this field in the user interface.

    Question:

    When the user queries in the applet for this field, the generated SQL code has no condition in a Where Clause to the query on PERSON_UID.

    SQL has earlier been something like...

    (T25. EMP_FLG = 'N') AND (T25. PERSON_UID LIKE: 3)

    But after you make this change, the current SQL is trimmed of the just

    (T25. EMP_FLG = 'N')

    This means that this isn't question with PERSON_UID, resulting in an impact huge performance.

    If someone could suggest on this issue, to the difficulty.

    Concerning

    Oh sorry, I guess I missed something.

    I guess the simplest solution is to store the values of redundantly (A, B the value of the value and the value of A + B) and stop using a calculated field.

    You could script something in the PreQuery event, but I think it's an ugly hack.

  • Labels for form fields and calculations

    Help, please!  I use Acrobat XI. I have 2 buttons that the user needs to check and I can't seam to label. I would like more than a label of reversal. My research is said to go to properties > Options and label here as a label and a name are different. Labelling is not an option for me here. I have two choices: stye and Radio button selection button.   Help, please!  Also, I tried to said the tax rate of NC of 6.75% for the resident of NC button and we found that I have to add a java script in the actions of a field AND an export value to check the properties of the area, is that correct? Could someone explain PLEASE.  Essentially, I have a subtotal box and to add sales tax (a different - when box checked) and come with the order total.  Thanks a lot for your help. Best regards, titi

    The last line should be:

    If (taxable! = "Off") {event.value = subtotal * tax_rate ;}} else {event.value = ' ' ;}}

  • How to keep the form fields empty with calculated fields

    I am to convert Excel files to Adobe forms with calculated fields.  I use the following if statement to keep the empty fields until the entry is made.

    var v1 = + getField("LengthRisersToday.1").value;

    var v2 = + getField("LengthRisersToDate.0").value;

    If (v1! == 0) {}

    var sum = v1 + v2;

    Event.Value = sum;

    } else {event.value = ";}}

    This does not work if someone from 0 in the field "today."  This is sometimes necessary in this form, as the other fields must be filled and a riser is not always added.

    This form consists of several lines and inscriptions are made there is a running total in column "on this day".



    So you say that a result no one is valid and that you want to delete a result of zero only if the LengthRisersToday field is empty? If so, the script can be replaced by:

    var s1 = getField("LengthRisersToday.1").valueAsString;

    var v2 = + getField("LengthRisersToDate.0").value;

    If {(s1)

    var sum = s1 + v2;

    Event.Value = sum;

    } else {}

    Event.Value = "";

    }

  • Total of fields and to change the font for values 0 color

    Hi, I'm relatively new to scripting, and I have created a form that is used both as a PDF to fill and print.  It's a decklist and I want to be able to total the fields for each specific type of map to display the toal in another area, and then add those fields for a total of bridge.  I can easily accomplish this depending on the sum in Acrobat X using the but when printing the list empty to be used by players at an event the zeros print in total fields and confuses the younger players.

    I would use a calculation script custom that totals fields and checks the total and also if it's zero changes the color of the font to white.

    Any help would be appreciated.

    Or you can put the code below in the validation.

    If (event.value == 0) event.value = ";

  • calculation fields do not work on the web

    I created a pdf to a word doc form.  I tested it and all fields of computing work very well, but then I'm going to post on our Web site and all calculation fields do not work.  The formatting in the field appears as well, which means that when I created the form to fill out that I made the fields of theses to represent a monetary unit (e.g. $5.00) and when I post on the web it appears simply as a number (5) and nothing in this column adds up.

    Any suggestions?

    No, you can't get them to work on any browser. Chrome has the most support for PDF and JavaScript forms, but it is not as comprehensive as Acrobat/Reader. Consider educate users to directly open the form in Adobe Reader.

Maybe you are looking for