Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Number and thousand separator in an animation

New Here ,
Aug 29, 2023 Aug 29, 2023

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

TOPICS
Expressions , Scripting
777
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 29, 2023 Aug 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 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2023 Aug 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2023 Aug 29, 2023
LATEST

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

 

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

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines