Copy link to clipboard
Copied
What would I enter in the Custom Format Script field if I want a number to appear as a percentage with 2 decimal places? So, for example, if 8 is written in the field, it shows up as 8.00%. I found this:
if (event.value) event.value+="%";
which shows 8 as 8%, but what do I couple it with to show 8.00%?
Thanks,
Sarah
Copy link to clipboard
Copied
Use this:
var x = Number(event.value);
if(event.value)
event.value = x.toFixed(2)+"%";
Copy link to clipboard
Copied
Use this:
var x = Number(event.value);
if(event.value)
event.value = x.toFixed(2)+"%";
Copy link to clipboard
Copied
Works beautifully, thanks so much Nesa!!
Copy link to clipboard
Copied
I am trying to use this script but i can only get it to work in one cell or one place how can i change the script to use it in multiple places where i want to show inputed percentages
Copy link to clipboard
Copied
It should work in different fields as long as you put in custom format script.
Copy link to clipboard
Copied
Thank you so much! Works
Copy link to clipboard
Copied
The script works as expected if I only input values into the original scripted field. However, there are many other unscripted fields, and when I put any value into them, I get a NaN% error in the original field. Please help.
Copy link to clipboard
Copied
You need to explain what exactly you are trying to do and what script did you use, and where did you place it?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more