12-29-2014 2:40 PM
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;
}
}
}
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.
12-30-2014 8:55 AM
Hi, Saiyog!
Is display field of numeric or decimal type? Try to change it to decimal.
12-30-2014 9:28 AM
Hi Nikolay,
display field i tried with decimal and numeric both..its not working..so i posted it..
12-30-2014 10:20 AM
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.