Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Subtotals format in Adobe forms when using javascript

former_member193376
Active Contributor
0 Kudos

Hi,

I am calculating subtotals in adobe forms using java script and I am using numeric field to display.

Script code:

var qtotal = 0;

for (var j=0; j <= xfa.layout.page(this)-1; j++){

var fields = xfa.layout.pageContent(j, "field", 0); 

//xfa.host.messageBox(xfa.layout.page(j).toString());

for (var i=0; i <= fields.length-1; i++){

if (fields.item(i).name == "VALUE"){

qtotal = qtotal + fields.item(i).rawValue;

}

}

}

  1. this.rawValue = qtotal;

I am getting the output as 680,000 but I need it as  6.800,00 .

I tried using patterns but it’s not working.

3 REPLIES 3

nikolayevstigneev
Contributor
0 Kudos

Hi, Saiyog!

Is display field of numeric or decimal type? Try to change it to decimal.

0 Kudos

Hi Nikolay,

display field i tried with decimal and numeric both..its not working..so i posted it..

0 Kudos

I would try to bind the calculated value to a decimal field without any patterns. If it wouldn't help - then it's time for testing

Some options for you to check and test:

1) check the value in qtotal (e.g. show it in a messagebox)

2) try to bind qtotal to any other decimal field - maybe it's just a "bad" field and you just need to recreate it. I've seen an unexplainable behaviour of fields a couple of times.

3) and - by the way - does the field has enough width for the calculated value? If the value would overlap the cell you can get format surprises from the field.

If it still wouldn't help, then I'd like to have a look at the form.