Previous | Next | (P-PDF) JavaScript
Topic: Re: french format number (Via Email)
Conf: (P-PDF) JavaScript, Msg: 28398
From: prodok
Date: 10/11/2001 05:22 PM
Using the substr() method is the right way. However, you do not get
the right input.
Have careful look at your code, and you will see that your variable a
is a Field object, as your variable b. A Field object has many
properties, such as background color, border line width, font size,
and value.
The substr() method is, on the other hand, a method of the String
object. See something does not match.
The very first thing to correct this is to make sure that the your
substr() method gets a string.
The next thing you will have to find out is how your a.value actually
looks. If you have the field formatted, the field value will not be
formatted. In this case, you might also use the util.printf() method,
as you have the same "raw material".
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
e-mail: mailto:max@prodok.com
http://www.prodok.com
[ Building Bridges for Information ]
______________________
Shameless Plug:
I will have presentations and pre- and post-conference workshops at
the .PDF2001 West Conference in Scottsdale, AZ, Nov. 5 to 7, 2001.
More details at http://www.pdfconference.com.
Workshops:
Nov. 4: Implementing Business Processes based on PDF
Nov. 8: Enhancing PDF Forms
_________________________
>I have a form, english and french, my client require that when she
>fill out form in English version, it is automatically fill out in
>Frech version. I have a problem the French format number. I try to
>use substring function to take the number, and I use add string to
>add space between the number. I don't know why it is not working.
>
>In English version I use to add 3 fields;the total, format number as 3,465.55
>
>var a =this.getField("Total")
>var b=this.getField("Totalfrench")
>var c= a.substr(0,1);
>var d= a.substr(3,5);
>var e= a.substr(6,8);
>b.value= c.value+" " d.value+e.value
>
>
>I don't know why it is not working? Or I have to use the function
>split, or trim the number. This is try me crazy. Thank you very
>much for your hint.
>