• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Slider control price countdown

Community Beginner ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hi, i'm stuck in this problem and maybe it's just a simple trick.

I need a way to make a countdown of a price with baseline shift on the two last numbers. The price should go from 22,25 to 19,95.

If i use slider control with the expression: Math.round(effect("Slider Control")("Slider"))  - i can't format the text to baseline shift.

TOPICS
Expressions

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Yes, any formatting of individual letters gets lost if you apply an expression to the source text. This happens for all expressions and not specific to the Math.round. Hence, the only solution is probably to split this into two separate text layers.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hi Mathias

I thought so, but my problem is how to make the counter in two separate text layers?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

use this to get the number without fractions

var val = effect("Slider Control")("Slider"); // pick whip slider here

Math.floor(val)

and this to only get the fractions:

var val = effect("Slider Control")("Slider"); // pick whip slider here

var result = (val%1+"").substr(2,2);

while (result.length < 2) result= result +"0";

result

In general, for complex counters I highly recommend my iExpressions Counters:

https://mamoworld.com/after-effects-expression/counter-numbers

counter_numbers_0.png

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hmm, it counts...

But the amount doesn't follow the fractions when it passes zero. I need to countdown from 22,25 to 19,95.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

LATEST

oops, must be Math.floor(val)  instead of Math.round(val)

I corrected it in the answer above.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines