Skip to main content
Participant
August 29, 2023
Question

Number and thousand separator in an animation

  • August 29, 2023
  • 3 replies
  • 983 views

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

This topic has been closed for replies.

3 replies

Mylenium
Legend
August 30, 2023

https://www.motionscript.com/design-guide/counter.html

 

No need to reinvent the wheel. Just substitute the comma with whatever spaces you want.

 

Mylenium

Mathias Moehl
Community Expert
Community Expert
August 29, 2023

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 '  '

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participant
August 29, 2023

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 😞