PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________

OK, you have that function. I assume that this function takes a string and places it accordingly into individual boxes. Assuming that you have to serve earlier versions of Acrobat than 6, you can not use the (Acrobat 6-specific) comb field property (which would pretty much solve your issues, as it is a regular field property...).

So, what you would need in that case is something which creates a string looking like what you need.

Acrobat JavaScript has a pretty useful function which pretty much does what you need. This function is the printf() method of the util object. You will find its syntax in the Acrobat JavaScript Scripting Reference.

So, assumed, your working variable you feed into the combing function is named "feedin", you would add the following line of code immediately before you call that function:

feedin = util.printf("%.2f", feedin) ;

And that should take care of it. Note that a similar construct is powering the pre-cooked formats in Acrobat.

Note that when you use the printf() method on a numeric value, you might lose its capability to be involved in calculations, because it is no longer recognized as a numeric value by (Acrobat) JavaScript; you would then have to get it back to a number again, or better, keep a hidden field with the correct numeric value.

Hope, this can help.


Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland

Fax:  +41 1 700 20 37
  or  +1 815 425 6566
e-mail:  mailto:[EMAIL PROTECTED]
http://www.prodok.com



[ Building Bridges for Information ]


______________________




Shameless Plug:

My next conference appearances and workshops:
• Conference presentations at the 2004 Symposium of the BFMA, May 23 to 27 in Reno, Nevada (http://www.bfma.org) and pre-/post-conference workshop, May 22/23 and 27, organized by essociates Group (http://www.essociatesgroup.com/AdvancedAcrobatForms.htm)
• And, as always, available for on-site workshops/tutorials/consulting.



_________________________







I have a function that combs the amount field into individual boxes. the problem is when I autofill the field with 1650.00 the value that gets combed is 1650 well you can just imagine what happens when the decimal is not there. If I key the amount 1650.00 into the field then the combing works.

I did a console print of the value comming out of the field just after autofilling it and it is 1650




To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html



Reply via email to