Copy link to clipboard
Copied
I have a format custom script.
if (event.value !=="" && !isNaN(event.value)){
event.value = util.printf("%.2f",event.value*100);
}else{
event.value = "";
}
and a custom validation script........
if (event.value !== "") {
event.value = event.value / 100 ;
}
if (event.value>1||event.value<0)
{
event.value="";
app.alert("L’entrée doit être entre 0 et 100")
}
I need my Percentage field to read 1,50 % (French)
Currently it reads 1.50 % (English)
Any help would be appreciated.
Use this:
util.printf("%,3.2f",event.value*100);
Copy link to clipboard
Copied
Use this:
util.printf("%,3.2f",event.value*100);
Copy link to clipboard
Copied
This worded perfectly.
Thank you very much!
Copy link to clipboard
Copied
Hello Try67
I was wondering if you could help me a little further with this script.
This is the comment I received back from the Translator on my 1,5 %
If I type a percentage with a comma, the percentage disappears.
If I type it with a period, the percentage converts into French format with a comma.
Could we have it set so that both a comma or a period can be used when typing a percentage and still appear in French format in both cases?
Try67, is this possible?
Again your help would be greatly appreciated.
Copy link to clipboard
Copied
That would require a custom-made Format and Keystroke script.
On 30 March 2018 at 00:28, marilynr59152174 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Should I post as a new question?
I currently have this Custom format script
if (event.value !=="" && !isNaN(event.value)){
event.value = util.printf("%,3.2f",event.value*100);
}else{
event.value = "";
}
But nothing in the Custom keystroke script.
Validate tab, Run custom validate script
if (event.value !== "") {
event.value = event.value / 100 ;
}
if (event.value>1||event.value<0)
{
event.value="";
app.alert("L’entrée doit être entre 0 et 100")
}
Thanks again
Copy link to clipboard
Copied
Basically you would need to replace the comma in the new value with a period to achieve it.
Copy link to clipboard
Copied
Unfortunately that doesn't work.
The person filling out the form may enter 1.5 percentage in English (with period) or 1,5 French (with comma) and the end result should be a French Percentage as it is a French form.
Currently if a French person enters French percentage 1,5 and the tab or enter key the field becomes blank.
Copy link to clipboard
Copied
app.alert("L’entrée doit être entre 0 et 100")
Ça ne répond pas à la question posée mais tu devrais faire très attention aux caractères accentués dans les messages d'alerte (entre autres).
Il faut absolument que tu lises cet article : https://www.abracadabrapdf.net/?p=633
Sous peine d'obtenir ça :
Au lieu de ça :