Copy link to clipboard
Copied
Hi everybody,
I have an animated number in AE.
I aleardy use JS in this animation : Math.round(effect("Paramètre glissière")("Curseur"))
The problem is : the number is written in english : 76000
I would like to ad a thousant separator : 76 000
I tried several formulas but it did'nt work.
Do you know haw I can do that ?
Many thanks
Copy link to clipboard
Copied
Uptade : i tried this
NUM = Math.round(effect("Paramètre glissière")("Curseur"))
NUM.toLocaleString("fr-FR")
Now there's a space...but very tiny 😞
Copy link to clipboard
Copied
If you have iExpressions, you could use the Counter Number iExpression.
In the user interface of the iExpression you can enter any symbol as thousands separator symbol (also something like multiple spaces for bigger gaps).
In your expression, you could add some code which replaces each space by multiple spaces to make the space wider:
NUM = Math.round(effect("Paramètre glissière")("Curseur"))
NUM = NUM.toLocaleString("fr-FR");
NUM.replace(/ /g, ' ') // note that there are two spaces in the string ' '
Copy link to clipboard
Copied
https://www.motionscript.com/design-guide/counter.html
No need to reinvent the wheel. Just substitute the comma with whatever spaces you want.
Mylenium
Find more inspiration, events, and resources on the new Adobe Community
Explore Now