How To Create Number Counters with Decimals, Symbols & Commas in After Effects
May 3, 2024 · Mike Murphy
This tutorial will show you how to create a number counter and control decimal places, add symbols and commas in Adobe After Effects CC 2024.
Adobe After Effects CC 2024: Slider Control Counter, Decimals, Symbols & Commas
**Description:
**This tutorial will show you how to create a number counter and control decimal places, add symbols and commas in Adobe After Effects CC 2024.
Keyboard Shortcuts:
EE: Reveal Expressions
UU: Reveal Keyframes
**Control Decimal Places:
.**value.toFixed()…no decimal places
.value.toFixed(2)…2 decimal places
Countdown Timer Tutorial (from 2023):
https://youtu.be/bY1CD8Cr0a8?si=z4E4yUPveZPJNo-Q
Note:
Slider Controls are limited to 1,000,000 for Number Counters (there are tons of workarounds if you search on YouTube if you need to go higher than 1 million)
——————
Auto-Add Commas Expression (Default):
num = value;
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
addCommas(num)
Modified Expression Used in Tutorial:
num = effect("Slider Control")("Slider").value.toFixed();
function addCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
addCommas(num)
**Expression Source:
**
Ukra Media
———————
To try or buy Adobe After Effects CC 2024:
https://mikemurphy.co/adobe (affiliate link)
⭕️ Check out my new Domestika Course on Adobe Audition:
https://mikemurphy.co/domestika
——————
Chapters:
00:00 Intro: About The Tutorial
00:28 Add Text Layer
00:41 Center Text + Number Counter
01:00 Add Slider Control
01:11 PickWhip Source Text To Slider Control
01:30 How To Animate Number Counter
01:59 How To Control Decimal Places
02:18 Add .value.toFixed()
02:50 How To Add Symbols ($,%)
02:19 Add Symbols Before ($)
03:42 Add Symbols After (%)
04:02 Add Commas
**Software Used:
**Adobe After Effects CC 2024 (Click To Try or Buy)
How Create Number Counter Using Slider Control:
- Create New Composition (1920 x 1080, 10 seconds)
- Add Text Layer
- Select Text Layer
- Go to Paragraph Panel…Click on ’Center Text’
- Go to Align Panel and center the text
- Press Cmd/Ctrl + Double-Click on Pan Behind Tool to center Anchor Point
- Go to Effect Menu…Expression Controls…Slider Control
- Twirl open the Text Layer
- Twirl open ‘Text’
- Press Option or Alt Key and click on stopwatch next to Source Text
- Locate pick-whip and drag it to ‘Slider Control’ in the Effect Controls panel
- Drag Playhead to the beginning of the Timeline
- Click on the stopwatch for Slider Control
- Enter Value of 0
- Drag playhead down the timeline
- Change the Slider Control value to 500 or desired end number
- Press Spacebar to Preview
- The countdown should be working but with decimals
How To Remove Decimals & Round Down Countdown Timer:
- Select Text Layer
- Tap ‘EE’ to reveal expressions
- Click in the expression editor on Timeline
- Move the cursor to the end of the expression
- Add .value.toFixed()
- .value.toFixed() for no decimals
- .value.toFixed(2) for 2 decimals
How To Add Symbols Before & After Numbers:
- Select Text Layer
- Tap ‘EE’ to reveal expressions
- Click in the expression editor on Timeline
- Move the cursor to the beginning of the expression
- “$” + to add dollar sign before number
- Move the cursor to the end of the expression
- + “%” + to add percent sign after number
How To Add Commas for numbers over 999:
- Select Text Layer
- Tap ‘EE’ to reveal expressions
- Click in the expression editor on Timeline
- Paste expression from above
- Replace ‘value’ with the expression created from Slider Control
- Tap Spacebar to preview