Hi Dan,
Thanks for the quick reply. This works great even when I added this
n = effect(“Slider Control”)(“Slider”).value.toFixed(1);
n[n.length-1] == “0” ? n.substr(0,n.length-2) : n.replace(“.” , “,”)
I work in Germany so the decimal point is actually a comma. I then wanted to add a percentage sign (%) to this and I got stuck again. Simply adding +”%” messed up the comma and the removal of the zero decimal. I tried
n = effect(“Slider Control”)(“Slider”).value.toFixed(1).replace(“.” , “,”);
n[n.length-1] == “0” ? n.substr(0,n.length-2) : n +”%”
which works well untill there is a decimal zero but the decimal zero and the % dissappear
Any Ideas? I’m sure I’m overlooking something simple.
This is actually one of several improvements I’m making on a german election after effects project which you helped me out with a couple of years ago! Back then after recieving so much help from the creative cloud forums I offered the project to anyone who wanted it and a couple of people got in touch, so I sent it to them. If I manage to get this sorted out again, anyone who needs an “election rig” can get in touch and I’ll send it out.
Thanks again for your help