Negative numbers does not work in the calculation

I'm new to calculations of form fields and have encountered a problem that I can't solve. I have a form with calculations. There are four columns (beginning balance, revenue, expenditure and balance) the problem occurs when a negative number is specified for the opening balance. My calculation should start balance + revenue - expenses = balance but if a negative balance of start's ed and you tab to end receptions, enter received, expenses tab, enter the expenses, balance tab I get error "the value entered does not match the format of the field". "." If the opening balance is a positive number, there is not a problem. I can send someone a copy of the form if this help solve this problem. For any help or suggestion would be greatly appreciated.

I use Acrobat 9 Pro

Here is a sample of my closing balance calculation:

Get the first value in the field
"var v1 = getField (start Balance.7") .value;

Get the second field value
var v2 = getField("Receipts7").value;

Get the first value in the field
var v3 = getField("Expenditures7").value;

The value of this field value equal to the difference
Event.Value = v1 + v2 - v3;

Computers don't perform calculations using decimal values but convert decimal values in binary values, perform the calculation of the binary base and then convert decimal values. Since for many decimal value, there is not an exact conversion value a little mistake gets introduced in the values and the calculation. Change the 'None' format and expand the field for the result, we see a value-1.8189894035458565e - 12 or the value of-'0.' followed by 12 zeros, then the 1.8189894035458565 value. A very small value. If we round the value of the calculation (not the format displayed in the Format option) you can get the answer of $0.00. We can check this result by changing the 'Format', 'None' option and expanding the field to account for the long value.

I would use the util.printf method to perform the rounding for the result of the calculation.

Your calculation script could be:

Get the first value in the field
"var v1 = getField (start Balance.7") .value;

Get the second field value
var v2 = getField("Receipts7").value;

Get the first value in the field
var v3 = getField("Expenditures7").value;

The value of this field value equal to the difference
Event.Value = util.printf ("%,101.10f", Number (v1) + Number (v2) - Number (v3));

This script rounds to 10 decimal paces ensuring that the result will be the value that can be displayed using the number format.

Tags: Acrobat

Similar Questions

  • HP g7-1320dx - on the numeric keypad does not work and the Num Lock will beep when you press

    Today, I noticed that my keypad does not work. The keys / *-+ and 'Enter' works, but the actual number will not.

    When I press NUM LOCK, it only beeps and turns the light active or not. And the keys / *-+ and 'Enter' won't work, any more than the actual digital keys.

    The regular keyboard numbers and keys all work, it is a simple matter of numeric keypad.

    Any ideas?

    So I thought that my own problem.

    "I went to the "Ease of access" >"mouse settings"> "paved digital use to move the mouse on the screen" and it has disabled."

    I hope it helps someone else in the future!

  • Reinstalled vista now the modem does not work, says the modem is already in use. Modem does not appear in the material...

    Vista Basic with dial-up. I reinstalled vista and now the modem will not work with any of the numbers given by my provider. He throws error numbers (Sorry didn't write them) and said that the modem is already current usage or other computer is busy. The modem does not appear in the lists of material and reinstallation does not work. The computer does not recognize when a new modem is installed either. I use the same drivers provided with the computer when I got it.

    Hello

    I suggest to refer to this link and follow the instructions in the link below and check, if this can help:

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-modem-problems

    It will be useful.

  • I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    Hi yjain51,

    I understand you had some problems recently with getting Touch ID to work reliably on your iPhone 5s. I know that it is a feature of great security for your iPhone, so I'm happy to help you.

    When you use Touch ID, make sure that your hands are free of any dirt or moisture so that fingerprints can be read clearly. This article explains further:

    Use the ID Touch on iPhone and iPad - Apple Support

    Thank you for using communities Support from Apple. See you soon!

  • Download Nikon D90 photos via a cable of Photos does not work. The picture freezes and does not matter. Any ideas?

    Download photos of Nikon D90 Photos OS El Capitan 10.11.16 cable does not work. The picture freezes and does not matter. Any ideas?

    Try with Capture of Image (in your applications folder)

    LN

  • My apple pencil does not work after the 9.3.4 update.

    My apple pencil does not work after the 9.3.4 update. I tried to restart but still does not work. Tried to forget the device and whenever I connect the pencil to the ipad pro, it is said that it does not recognize the cable / device. Help please.

    < re-titled by host >

    Greetings RechargeableJam,

    Welcome to the communities of Apple Support!

    I see that your Apple pencil does not work after update to iOS 9.3.4. I guess it's about to have a problem with something that worked with the previous version of the iOS software. I'm happy to help you to help you find the best resolution.

    First of all, let's close open applications on your iPad Pro. This can ensure that there is nothing running in the background that is causing a conflict. The following article will help you:

    Force a nearby application on your iPhone, iPad or iPod touch

    Then connect the pencil of Apple and see if it is recognized for the time being. If you don't see the Pair button, wait a minute while your Apple pencil costs. Then disconnect your Apple pencil, Plug and back on hold until you see the button in hand.

    Best regards.

  • AutoComplete does not work on the address field.

    AutoComplete does not work on the address field. This means that the completed form is missing from the address. What is special about the address field and why doesn't autocomplete work? I have NOT opted for "don't follow it.

    http://www.thepetitionsite.com/TakeAction/918/708/047/

    Hi robmm76. I looked at the link you provided. It seems that the reason why AutoFill does not work for the address field is because of the way this field has been programmed on the site. It has been programmed to make type you part of your address and click on the right pair and it would then fill in city, State and zip code. If this field is just a special case.

    I hope this information answers your question. If you need more information or help please do not hesitate to reply to this reply.

  • Acorn TV does not work on the new Apple TV

    So disappointed that the Acorn TV app does not work with the new Apple TV we just bought. We have subscribed on iTunes and nothing happens when you try to activate the software. We can look good on the MacBook, iPad and iPhone. Verified the purchase on iTunes account and that's fine. Contact Acorn and say it is a matter of Apple.

    Strange that I have to use Chrome to even write this question. Safari and hers do not work with the Support pages. I'll send in the comments.

    I'm resetting Apple TV now. We have been with the Apple TV since version 1. I hope that we can make this work!

    How would work appletv mount 1 app on the job?

    each app to live their own lives the appletv core do not even know what applications do they just

    Use the ios network to get their content

  • Shortcut Ctrl C does not work in the main window of Firefox

    I use Firefox version 38.0.5, Windows 7
    Since the update Ctrl + C shortcut does not work in the main window of Firefox. (I can't copy text from any website using Ctrl + C).

    Click right and using the copy in the menu works perfectly. CTRL V and Ctrl X work fine without problem.

    Ctrl C works fine when copying text from the address bar and search bar, I just can't copy anything from anything in the main window of firefox.
    

    I tried to run Firefox in safe mode, I have also reset firefox and a virus scanner, but nothing has solved the problem.

    If anyone has any suggestions, that would be great. Thank you

    See:

    • bug 1173979 - copy Ctrl + C is broken in the last Irish FF 38.0.5

    Please, do not comment in bug reports
    https://Bugzilla.Mozilla.org/page.cgi?id=etiquette.html

  • Search Safari 9.1.1 does not work in the url field. Tabs are not securities.

    After I instaled 9.1.1 safari search option does not work since the URL field and tabs is not titles. IOS 10.11.5 macbook pro late 2011.

    Restart your Mac while holding down the SHIFT key. Secure boot is slow, so give it time to start your Mac completely and then restart normally.

  • can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    Are you sure that you do not have to register on this site through the usual way and what you should be used elsewhere on the site?

    Have you tried to contact them to help this topic or to check if they have a FAQ on this subject?

    I found this in another thread that you created [*]:

    I'm not sure do I bought a home income internet james ashley program and I copied the login info I was given and the password does not fit into the window of password and I forgot the link password does not work I sent emails, but do not receive an answer im don't know what to do is anyway you can help me to recover my info or help me change the password?

    I assume that you have downloaded and installed this program and need to use this password in this program or only you can use these data to download the program from the site james ashley?

  • SQLite Manager does not work with the v11. Until make you it easier to go back to older versions or newer versions stop, breaking most of the modules I won't use Firefox

    SQLite Manager does not work with the v11. Until that make it easier to return to older versions or newer versions stop, breaking most of the modules I use FirefoxHow to come back at 10 Firefox?

    Update Firefox 23.0 which published yesterday afternoon.

  • Safari does not work in the iOS on ipad 2 and 4 9.3.1

    Safari does not work in the iOS on ipad 2 and 4 9.3.1

    Assuming that other internet such as connectivity features

    E-mail

    YouTube app

    Music streaming

    works very well

    Settings - Safari - erase data and history of the site

    Do a forced reboot - after all open applications using the app Chooser - invoked by fast double pressing the home button and drag upwards on each app until it disappears from the screen.

    Meet the sleep/wake and home buttons down until you see the logo  - then release and allow normal start upward

  • The new tab (+) does not work, or the file/new tab feature

    The new tab (+) does not work. The function of the file/new tab does no more work. Both had worked correctly until noon today. I haven't added any software, plug-ins or extensions today, I do not have the Ask toolbar. I tried several of the suggestions made on this site, nothing helps.

    This problem may be caused by an extension that does not work in the current version of Firefox.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do not click on the reset button on the start safe mode window or make changes.
  • When a pdf file is open in a tab, automatic scrolling of the cushion does not work in the other tabs, but only for the specific PDF tab.

    The Tablet/mouse scroll function does not work for the other tabs when a PDF file is opened.

    Hi ESNE,.

    Have you checked to see if your PDF is updated? You should take a look at the Base files display PDF in Firefox article. There are lots of good information in there. You should try both of the suggested PDF Add-ons to see if this solves the problem.

    Hope this helps!

Maybe you are looking for