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