These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Replacing a minus number with text

sprinter1801
Registered: Mar 9 2011
Posts: 2

Hello All
 
Please could someone help me with a problem I have in Acrobat,
 
I have a form that I use for my company phone bill
 
At the bottom of the form I have a box with the total amount I have to pay, but some times after taking of my allowance this is a minus figure.
 
What I would like is to replace this minus figure with the word NIL
If it is a plus figure then I would like the amount displayed in it.
 
I think I need some kind of validation script but don't know.
 
Any Help would be good
 
Many Thanks

My Product Information:
Acrobat Pro 9.4.2, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
This might be best handled with a Format script:

  1. if (+event.value < 0) {
  2. event.value = "NIL";
  3. } else {
  4. event.value = util.printf("$%.2f", event.value);
  5. }
sprinter1801
Registered: Mar 9 2011
Posts: 2
That worked great.
Thank you very much