Numbers counting up with commas, decimals [ULTIMATE GUIDE] - After Effects 2020 Update
Вставка
- Опубліковано 6 жов 2024
- A comprehensive look at how to create numbers counting up in After Effects and create a preset for it so you never have to make it again.
In this lesson we also animate it with commas, decimal points and percentages as well as any other prefix you want to add.
For numbers with commas
s = "" + Math.round(effect(1)(1)[0]);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
For decimal points to 2 places
s = "" + (effect(1)(1)[0]).toFixed(2);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
This will only work if the point controller (or your language equivalent) is the first effect in the effects stack.
Want to help out the channel?
Get The "Lyric Video Creator Kit" Here: www.lyricvideo...
What's Included
✅ 60 Animated Presets
✅ Bonus Thicc Marker + 4k Neon pack
✅ Premiere Ready
✅ Full Tutorial
No After Effects Skills Required
Get it here!: www.lyricvideo...
it's 2023 and I cannot thank you enough! the slider was giving me headaches. Point Control makes so much more sense. Thank you from a new sub!
Oh amazing. Glad I could help 🙏
Amazing. I found tutorials for adding prefixes, suffixes, commas, and decimals, but none that let you do it all at the same time like this. Thanks so much, bro!
Same!!!
For the german people:
Da der Code auf Englisch ist, solltet ihr den Begriff "Point Control" neu zuordnen. Generell lautet der Effekt auf Deutsch "Einstellung für Punkte".
1. Ihr macht alle Steps nach, wie es in dem Tutorial gezeigt wurde
2. Sobald ihr den Code in den Source Text Bereich eingefügt habt, nutzt ihr das Lasso-Tool (das Symbol, welches neben dem Quelltext zu finden ist) und verbindet es zum "Effekt -> Einstellungen für Punkte -> Punkt"
Thanks for the great tutorial, Nick!
Love it. Thanks so much for translating
Having that cheat script posted has saved me more times than once... If only I could like this video as many times I've used it.
OMG I've been struggling to find a solution for this, YOU HAVE SAVED MY PROJECT! THANK YOU SO MUCH!!!
just ran into the same problem of running into the limit of 1 Million, just happened to find yours so I'm stoked! Thanks for the help!
Glad it helped!
thanks! easier than other tutorials ! amazing !
Thank you 🙏
Sweet. I never thought about using a point control to get around the slider limitation! Also, some coding trivia:
If you really wanted to have more than two decimals, you can use the following regex:
s.replace(/\d(?=(\d{3})+\.)/g, '$&,')
And if you needed commas for decimals, then you can set the locale like this:
$.locale = "ru" // Russia for example
Number(s).toLocaleString().replace(/\d(?=(\d{3})+\,)/g, '$&.')
This is why I love you guys :)
How to animate if the number that I want to achieve is something like this: 0.134641354163578?
THANK YOU!!!! AMAZING. REALLY APPRECIATE YOU POSTING THIS VIDEO. SO HELPFUL WHEN OTHER VIDEOS DONT COVER THE SLIDER CONTROL CAPPING AT 1 MILLION.
You're welcome!
El mejor tutorial que haya visto, muy bien explicado, gracias por compartir tu conocimiento
finally someone who explains it properly! thank you!
Thanks a lot nick, now I can finish the project because of you! many thanks!
best tutorial - point control is perfect. this is the way. not slider.
Point Control gang! Aaaooo!
In case someone has the same problem I was having: I needed a count from 0,00 to 0,89, with commas and 2 decimal places. I was only able to make it work with this:
s = "" + effect("Point Control")("Point")[0].toFixed(2);
s.replace(/\./g, ",");
That is what ive been looking for hours! Thank you verry mutch
still doesn't work for me :(
it says: "Error at line 1 in property of layer 19 (NAME) in comp 'RECAP 2021'. couldn't turn result into numeric value
@@sofiaenault6373 Paste your code here
@@marksuzuki-tsuji7845 Awesome even cleaner code well done mate!
Thank you so much :)
Thank you so much!!
Thank you! Just needed the counter above 1 milly...worked perfectly. Thank you!
So helpful! You're the man, thank you!!
You just gained yourself a new subscriber. Thanks for this video, I've been using the slider control for a long time, didn't know there's an easy way to to this.
Eres un genio... muchas gracias... estuve atorado con esto hasta encontrar este tutorial.
Thank you so much... this is the best tutorial video 🤩
Yay! 🙌🏾 Success! After watching about 5 tutorials this one has helped me get that counting effect with the dollar sign!! Thank you so much!!
Ah nice. Glad I could help!
So how do you put a $ sign? Coz this video doesn’t explain that
great tutorial, thank you!
You’re welcome!
Amazing tutorial!! Thank you very much
You legend, this worked so much better than the slider! Thank you!
Glad it helped!
Worked like magic. Thanks Nick!
Thanks. This vid was exactly what i needed.
You’re very welcome 🔥
Make sure to have the point controller as the first effect in your effects stack before pasting the code otherwise it won’t work!
For numbers with commas
s = "" + Math.round(effect(1)(1)[0]);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
For decimal points to 2 places
s = "" + (effect(1)(1)[0]).toFixed(2);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
I get a Error with the second code. I don't know why.
Thanks for the tutorial!
This worked for me with 2 point decimal precision without an error :)
s = "" + effect("Point Control")("Point")[0].toFixed(2);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@@OnlyHooligan Yeah I realised right after I uploaded the tute that I could have put the whole thing into 1 formula! Glad you figured it out
Thank You so much......
I've got a single decimal point, but nothing moves up after the decimal point ...if that makes sense. It just goes 9.0, 10.0, 11.0, 12.0 and so on....I'm trying to get it to go 1.1, 1.2, 1.3 etc.
Thank you thank you for posting this! You're a life saver!
You’re very welcome
This is exactly what I needed. Thanks so much!
Mate thank you! So much value in this video much appreciated 🙏🏼
thanks man! you saved my life!
Fantastic work. HUGE help. Much appreciated. Apparently, I like two word sentences.
Ha! You win comment of the day
Video was great. Thank you so much
Thank you! you're my hero!
You are absolute legend! I am your new subs
life saver, tyvm :D
Glad to help!
you deserve a nobel
Ha if only!
Nicely done. I always forget how to add the commas+. A good combo with this is the plugin Monospace to lower the bouncing back and forth.
oooh I need to try that!
@@NickKhoo I had to do this again and forgot to save it. This one I'm posting has the option for a prefix and a suffix along with decimal values.
num = "$" + effect("counter")("Slider").value.toFixed(2) + "£";
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
addCommas(num)
I made the $ the prefix and the £ the suffix. On the same line, the (2) is the number of decimal spaces. All you need to do is add an expression slider on the text and call it counter. Hope this helps you
Marvelous! Absolutely helpful!
You’re welcome!
Saved me a lot of time, thank you! :)
You’re very welcome
thank you!! great video!!
thank you man,you are a legend
Happy to help!
this is the perfect video
thank you x 1000
You are amazing. Thank you for sharing good stuff.
Thanks FOREVER!
Ha you’re very welcome
Bless you soul brother
I receive that blessing 🙏
best tut ever 4:08
Amazing tutorial!! Thank you for making it so easy.
this is going to be great!
thank u for this guide. very useful 👍
You’re welcome!
Great information! Thank you.
You are a genius. Thank you.:)
I bought after effects to edit video, and they expect me to learn a who ass programming language just to make some numbers move, L Adobe
you however, are a hero my friend
Ha I’m glad I could help
Perfect! Thanks so much!
You’re welcome!
Dude you are a legend!
Aww thanks 🙏
legend! thank you
Awesome. this really helped : )
AMAZING!
thank you so much for your tutorial!
Love it - thanx !
Great! Thx a lot, mate!
You save my life haha thanks bro!
Ha I dunno about that but you’re welcome :)
tnx
Thank you so much
Bro thanks so muuuch for this
EXCELENT info and video! It deserves more views! I'd suggest you do some keyword optimization. I was quite lucky to find your video but many people might not be able to do so!
amazing!! thanks bro! 😁
OMG THANKS!
This is very helpful!
You’re very welcome!
This is absolutely amazing! Thank you! Would you know how to offset the numbers like a slot machine? If there is a way to do this that would be perfect!! Thanks!
Thank you! Can you link me an example of what you mean?
thank youuuu it such a big help
You’re very welcome!
youre a god WOOOOOOOOOOOOO
thank you brother!
You’re very welcome !
There's no way I was going to figure that out by myself!
Glad to help!
thank you
brilliant - thank you
You’re very welcome!
u da best!!!!! thx!
If someone wants to replace the points with commas e.g. for German notation:
s = "" + (effect(1)(1)[0]).toFixed(2).toString().replace(".", ",");
Thanks so much!
You’re welcome!
I swear I've triple checked this code when adding a percentage.. and it aint working for me, I've used this previously and worked very well, any ideas?
thank u i love you
You’re very welcome
Hi Nick
Not sure if I missed something in the video, but is there a way to make the decimal point in-between some text instead. My example would be I would like to show hours and minutes, So the full visual would be 34hrs40mins. We can add the mins to the end, but is there a way to get that hrs in the expression?
Thanks in advance
This would require some re-coding. Standby
THANK U
Great and thank you, I have a question: what if I want to change the font size of the Word after or before like (%) or ($)
Brilliant! Thank you. I would love to know how to effect the ("") or +"". Such as how to change colour or font size. Are there any code resources you could link or could you give us an example of code that would effect the these parameters.
Thanks a lot
You’re very welcome :)
THANK YOUUUU!!!!
Thanks a lot, you saved me a lot of time, i used to copy paste text next to the numbers and it was a nightmare. For some reasons, my text got pixelated once i applied the expression, has anyone else faced this problem? I tried changing the font, but it didnt help.
That’s super weird. Never heard of that issue.
Dziękuję!❤️
awsome expression, thanks for sharing
Thank you!!!!!!
mvp!
THX
Great tutorial thanks! How would you go about adding a percentage symbol to this?
9:11
Thank you for this tutorial! just what I was looking for!
is there a way to make this into a MOGART so I can quickly edit values on Premiere pro ?
Sadly I havent solved that yet...
What if I only want it to count by 100's? I"m counting from 500-6250 so I only want to count by 100's so it's not as fast
great job! how would you make i pass 1milion that the slider does not support?
You can’t! You need to use the point slider. Or add a multiplier to your expression
Honestly, a very useful tutorial to break the ice going into tNice tutorials software
Glad to hear that!
Great video! Is there a way to make the "$" text smaller than the rest of the text?
Did you find a way to make "$" smaller?
@@kaguongojames1458 unfortunately no 😢
I have a problem with the code. The numbers jump back and forth like crazy, also into negative numbers (-8.000 for example)
very strange. How many keyframes you using
This seems to be a very good tutorial! I get stuck though really early as I don't know how to "go to the comment section". How do you do that? Have been searching for a very long time now :)
If you're on a desktop computer it should be the first comment at the bottom of the video. But in case you can't find it
For numbers with commas
s = "" + Math.round(effect("Point Control")("Point")[0]);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
For decimal points to 2 places
s = "" + (effect("Point Control")("Point”)[0]).toFixed(2);
s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");