Skip to main content
ShiveringCactus
Community Expert
Community Expert
April 14, 2025
Question

Tutorial: Correctly format large numbers and currency with an expression.

  • April 14, 2025
  • 1 reply
  • 237 views

A quick expression to automatically add separators, decimals and currency symbols when using a text layer.

 

I have seen this problem raised a lot on the forums, namely how do you get the Expressions code or rather ExtendScript / JavaScript to automatically add thousands separators to numbers. And how can you have the same number displayed with different currencies? In the past I might have suggested replace(), split(), join() functions, but they are always a bit awkward to convert, but they are no good when splitting to begin with. But there is a simple function, built into JavaScript that After Effects can also use and it makes the whole thing simple:

Intl.NumberFormat().format()

With just a few options, you can easily format numbers according to any locale, making your project cleaner, smarter, and more professional.

 

1 reply

nishu_kush
Community Manager
Community Manager
April 18, 2025

Thanks for sharing the tutorial, @ShiveringCactus 


Thanks,
Nishu