Formatting text for dynamically generated numbers in After Effects just got a whole lot easier! In this episode I will introduce you to the uberNumber() function I designed combining numerous smaller expressions, to create an all-in-one number formatting tool.
Running time: 29min
Difficulty: Easy
Required tools: After Effects
Intro and Outro music: “Ghosts II” by Nine Inch Nails
Make sure to like/favorite/share this and other QubaHQ tutorial to help spread the word!
After Effects CC 2019 Update!
Robert Kjettrup brought to my attention the fact that due to the changes in how After Effects handles functions, the original UberNumber was broken and does not work in Adobe CC 2019 and higher.
Thanks to him and John Colombo (from Adobe) for providing me with a quick fix that makes it work in the new, recent versions of the software.
I have patched up the preset and re-uploaded it at the same link below. It should now work fine in After Effects CC 2019.
Download the files associated with this tutorial below:
- QubaHQ UberNumber
Tested with Adobe After Effects CC, Localized for English AE version
Download: QubaHQ_UberNumber.zip
Extract the downloaded file into your After Effects presets folder.
The tutorial can also be watched at YouTube and Vimeo.
This work is licensed under a Creative Commons Attribution 3.0 License.
21 Comments
Add comment
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Çiğdem Michalski liked this on Facebook.
First of all, I want to say that your Blog is the best! I really can’t wait for the next tutorial to come.
Two features, I think, would come ueberhandy:
1. colorcoding of positive or negative values – e.g. negative values turn red and positive turn black.
2. what if leading digits would not be limited to render “0” but could also be defined a [space] or any character you like it to be; points, dashes etc.? I know this could easily be done by seperating the number from the leading string (that, what could be written before the uebernumber argument in the script – hope you know what I’m referring to), but it would be a couple of clicks less, if that could be incorporated into the script.
what do you think?
I think I need a better, tiered comment system!
Hey Gunnar,
1. Color coding is a cool idea, but source text is probably not the best place to deal with it. I would probably approach it by making a text color animator and scripting on top of that.
2. This is a pretty cool idea – and I actually considered something like that. what made me decide against it was the attempt to keep the number of function arguments manageable. Logically speaking, such strings (let’s call them preSymbol and postSymbol) should sit somewhere next to the leadingDigits and decimalDigits. The function then would look something like:
uberNumber( number , leadingDigits , preSymbol , decimalDigits , postSymbol , decimalSymbol , digitGrouping , groupingSymbol , leadingSymbol );
to perform simple action of shortening both the integers and decimals to 3 digits you would then need to use:
uberNumber(x, 3, “”, 3, “”);
instead of the current syntax of:
uberNumber(x, 3, 3);
i had to make the cuts somewhere, and that was the functionality I decided to let go. Let’s see if any more cool ideas surface in the comments from the viewers – maybe after a few weeks or months I may create something like ubererNumber() – an appendix, a suffix of sorts – shorter tutorial that talks just about a revised version of the expression with added functionality.
Meanwhile, if you need to add symbols in front or rear of the numbers, you can do it manually:
in the expression replace: preStr=”0″+preStr with preStr=”#”+preStr to change the leading character to a hashtag (or any other symbol)
replace postStr=postStr+”0″ with postStr=postStr+”#” to change the trailing characters
[…] Formatting text for dynamically generated numbers in After Effects just got a whole lot easier! In Episode 5 of QubaHQ’s terrific After Effects tutorial series, Quba introduces the uberNumber() function he designed as part of an all-in-one number formatting tool. Visit QubaHQ to download the files. […]
[…] Quba Michalski has just released another tool to deal with numbers formatting in AE. Here: http://qubahq.com/2014/06/ubernumber/ […]
A pingback just brought to my attention a cool preset called “After Effects Number Generator” by David Benedetti. It provides similar functionality to uberNumber, but controllable via sliders, instead of code. Check it out at: http://www.davidbenedetti.it/after-effects-number-generator-expression-based-text-preset/
Not sure why it doesn’t work on my CS6 Mac. Installed in the Preset folder but can’t see it in the AE.
Hello…just purchased uberNumber, thanks for your efforts! I am trying to do a countup from 0 to 1,000,000,000 using an expression slider but it cuts off at 1,000,000. Is there any way around this limitation? Thanks!
First of all, thanks for the “purchase” :) I’ll have a drink on you :)
So apparently AE does not let sliders go above 1 Million. The walkaround is something like this:
x=thisComp.layer(“Adjustment Layer 1”).effect(“Slider Control”)(“Slider”)*1000;
uberNumber( x , 0 , 0 , “.” , 3 , “,” , “” );
You link x to your slider and then multiply it by 1000 before using uberNumber.
To get your uber to display 1,000,000,000 – set the slider to 1,000,000
To get your uber to display 1,000 – set the slider to 1.
To get uber to display 100 – set the slider to 0.1
10 will come from 0.01
and 1 will come from slider at 0.001
Now, you will notice it will give you a N/A when the slider is set at 0.00 – that’s a glitch that can be fixed by setting your slider at 0.0001 – this very small number will round down to a zero :)
That worked perfectly, thanks for the speedy support! I thought I was going to have to use multiple sets of numbers and somehow match them up and push them together. Just discovered your site, but I suspect I’ll be buying you more beer soon!
Thank you so much for creating this wonderful script! It’s really helpful to me right now. :)
Awesome! Care to share the results? I am always curious to see what people use my tools for, but rarely-if-ever get to see it.
Hello !
Very cool script ! But what about the “0” number ? it retrun “N/A”.
I add following so : if(x==0); else uberNumber(…)
Are you sure you are using the latest version? I am pretty sure I eliminated that bug…
Just tested it and I don’t have this problem.
I’ve just download the link above, it seems to be 1.2 version.
i retry and have same error, with CC oct14.
http://puu.sh/clXXi/41ddabdc6f.png
Very cool script by the way, i used to do countdown or things like these and it’s always complicated to write expressions. Yours is simple to use.
OK, you are 100% right, apparently. This is a small bug I did not bother fixing – here’s why:
If you link the value to an external source via expressions (for example connect it to a slider), even when the slider is at the value of “0”, it will work fine. Typing a static number in the expression can be simply replaced by typing static text (no animation, no need for uberNumber).
Good catch, anyway!
it’s strange because for the print screen i add “0” directly in ubernumber just for the exemple, but i first add the problem with a slider, but now i can’t reproduce, so everything’s good ! thanks
I too am getting the N/A for zero, but I am tieing my value to a multiplication of time rather than a slider. I added .0001 to my equation and it rounds to zero (and the correct number everywhere else). Annoying, but totally doable.
Everything else about this script is amazing! Thanks!
Quba – I just wanted to say a big ‘thank you’ for this really useful script. Very useful – and very generous of you.
My pleasure :)
If you happen to create anything interesting using it, make sure to share it – I am always curious to see what people end up doing using these little tools I build.
How to make UberNumber work with After Effects CC 2019:
Übernumbers doesnt work with the new Javascript Expression Engine in AE CC 2019, the problem is that in Javascript you are not allowed to have a Function after the expression, but need to have that before.
To keep the options at the top of the expression editor for easier access, the fix is to declare the current expression as a variable, and then run the variable after the function code.
LIke this:
ubernum = uberNumber( -1234.5678 , 5 , 5 , “.” , 3 , “,” , “$” );
{function code}
ubernum
I should not take credit for this, that belongs to John C from the AE team at Adobe for giving me the solution :-)
more info about javascript expression changes.
https://helpx.adobe.com/after-effects/using/legacy-and-extend-script-engine.html#expressions-function-declaration