Need help in formating a form dealing with negative currency | Community
Skip to main content
October 5, 2012
Question

Need help in formating a form dealing with negative currency

  • October 5, 2012
  • 5 replies
  • 6104 views

Need Help!!!

Creating forms in Adobe acrobat Pro I could format a number cell to calculate additions/subtractions of currency. If the result was negative I could get the cell to show the negative result in red text and show parentheses around them. How can I do that in LiveCycle?

If i have to use formcalc - what would i type in?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

Raghu_Nagireddy
Level 6
October 8, 2012

In LiveCycle can be done using the Numeric Field object and some formcalc script.

Use the "Numeric Field" from the Object Library. For the Field patterns (Select the placed numeric field, On object Window Object -> Field) use "num.currency{}" to show the currency(Ex: $) and "parentheses" if its negative. Write some script to show red text/border in red .

On exit event of the Numeric Field here is the script:

if($.rawValue <0) then $.font.fill.color.value = "255,0,0" endif  // This will make entire text in red color if the value is negative.

if($.rawValue <0) then $.validate.nullTest = "error" endif      //This will make border of the field in red color if the value is negative.

Hope this helps.

Jules2001Author
November 14, 2012

Raghu,

Thank you for your response.

Q: Same question but - What would it be if it was a negative interger?

Raghu_Nagireddy
Level 6
November 14, 2012

To work for both type of currency formats (Integer($1) and/or Decimals($1.99)), use the pattern as "num{($z,zzz,zzz.zz)}" instead of "num.currency{}". Script will be the same for any pattern.

"num{($z,zzz,zzz.zz)}": z - if digits present it shows, if not it ignores. This will work for -Ve, +Ve integers/decimals too.  instead of "z" if placed "9" it act as mandatory. ex: "num{($z,zzz,zzz.99)}". it always gives 2 trailing digits for input numbers.

Jules2001Author
November 14, 2012

Actually, I am refering to an actual numberic interger. like 1,2,3,4...etc

Not currency.

Would it be the same as above?

Raghu_Nagireddy
Level 6
November 14, 2012

Yes. Same pattern will work, but do need to remove the "$" sign, it should be like: "num{(z,zzz,zzz.zz)}".