Copy link to clipboard
Copied
Hello,
Everything is in the object.
I've developed a relatively complex pdf form with JS customization.
I would like to insert in a text field a string that would contain a formatted number field as it is displayed.
Example: the numerical value is 25.1 is displayed in the field as 25,10 USD***, (the formatting changes depending on user's choices in other fields, for example the same value might be displayed as 25,100 TND*** ...)
I wish to extract the string "25,10 USD***" not the 25.1.
I tried using the formattedValue/editValue/rawValue properties but none of those worked.
Is it possible to do what I want? If so, how can I do it?
Thanks
Copy link to clipboard
Copied
Formatting in Acrobat forms is done with JavaScript.
Try the "util.printx()"function.
But the better function is "util.printf()"
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
You must format the value.
Copy link to clipboard
Copied
Hello,
How can I achieve it?
I was able to format the number field (separator style, decimals, currency suffixe...) and display it correctly, but can't get the result in a string so I can use it in another text field.
Thanks
Copy link to clipboard
Copied
You can use util.printf for this.
Copy link to clipboard
Copied
Ok, I came across the util.printf but was not able to control the thousand separator.
Please can you confirm that the formattedValue property in no longer functional or if it has a substitution new property?
Thanks
Copy link to clipboard
Copied
I have never seen a property with the name formattedValue.
Copy link to clipboard
Copied
Here is some old reference to the formattedValue property:
https://blogs.adobe.com/formfeed/2011/06/understanding-field-values.html
Is there a way to control the thousand separator through util.printf?
Thanks
Copy link to clipboard
Copied
util.printf uses the format specs of C/C++.
Copy link to clipboard
Copied
Hello,
I was trying to fix the decimal and thousand separator issues but I coudn't figure it out.
It is not possible to change the decimal symbol from dot to comma without changing the location settings, but this doesn't seem to work in Acrobat JS.
The argument for the thousand separator %,d doesn't work either.
Any suggestion?
Copy link to clipboard
Copied
What format does you use in the form?
Copy link to clipboard
Copied
I found those three values discussed here https://blogs.adobe.com/formfeed/2011/06/understanding-field-values.html in the context of XFA (LiveCycle Designer) forms - though the blog post at no point mentions that! That will do no good for Acrobat forms.
Copy link to clipboard
Copied
Ok, it's clear thanks.
Is there any equivalent in Adobe forms?
Copy link to clipboard
Copied
Formatting in Acrobat forms is done with JavaScript.
Try the "util.printx()"function.
But the better function is "util.printf()"
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Hi,
Thanks, the link you provided is gold, it perfectly solved my problem.
I find however, that no direct way to extract a string as it is displayed in a field is a pity!
Thanks
Copy link to clipboard
Copied
Is this "formatted field value" used in other scripts that need the real value? If not, then just move the fomatting to the calculation. Then the real value is the formatted value.
If the real value is needed, you can use a two field solution, a hidden field that contains the real value, and the visible field that contains the formatted value.
Use the Acrobat JavaScript Reference early and often

