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

how to remove decimal value (.00) from slider control

New Here ,
Mar 08, 2015 Mar 08, 2015

Copy link to clipboard

Copied

Please ask me how to remove decimal value (.00) from slider control and add % (if possible) in after effects cs6.

Views

76.8K

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

correct answers 1 Correct answer

New Here , Mar 08, 2015 Mar 08, 2015

I guess you mean to animate text with a slider.

Add a slider control (expression controls) to your text layer, and then, add this expression into your Source text:

x=Math.floor(effect("Slider Control")("Slider"));

x+" %"

that's all

Votes

Translate

Translate
LEGEND ,
Mar 08, 2015 Mar 08, 2015

Copy link to clipboard

Copied

You can't.

Mylenium

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 ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

You absolutely can

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 ,
Mar 08, 2015 Mar 08, 2015

Copy link to clipboard

Copied

Precompose, then mask it out.

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 ,
May 28, 2019 May 28, 2019

Copy link to clipboard

Copied

I'm already triggered

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
New Here ,
Mar 30, 2020 Mar 30, 2020

Copy link to clipboard

Copied

...

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
New Here ,
Mar 08, 2015 Mar 08, 2015

Copy link to clipboard

Copied

I guess you mean to animate text with a slider.

Add a slider control (expression controls) to your text layer, and then, add this expression into your Source text:

x=Math.floor(effect("Slider Control")("Slider"));

x+" %"

that's all

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 ,
Mar 08, 2015 Mar 08, 2015

Copy link to clipboard

Copied

If you add this expression to an expression slider it will only return whole numbers.

math.round(value);

You will not be able to manually grab the slider control and make adjustments but you will be able to scrub through the values in the expression control and only end up with whole numbers.

Screen Shot 2015-03-08 at 10.48.44 AM.png

If you want to add a % sign to the slider control you can't do that, but if you want to use the slider to drive a text layer then francoisg32545302 has given you an expression that will work. It will help us a lot if we knew what you were trying to accomplish.

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
Explorer ,
Sep 05, 2016 Sep 05, 2016

Copy link to clipboard

Copied

Rick, you can always write the "Value" before the "math.round", then you can change the digits straight from the effects control.

something like this:

value = Math.round(effect("Slider Control")("Slider"))

Ido.

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
New Here ,
Mar 09, 2018 Mar 09, 2018

Copy link to clipboard

Copied

Hey thanks It worked for me...

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
New Here ,
Mar 16, 2021 Mar 16, 2021

Copy link to clipboard

Copied

Thaks @idoshor Thats work

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
New Here ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

now that's a value comment. Many thanks. 

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
New Here ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

LATEST

I pasted this action to my slider control value and boom... All the decimals were gone...
Insta: ramin.bahadori

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
New Here ,
Mar 13, 2019 Mar 13, 2019

Copy link to clipboard

Copied

I use this and works too:

x=Math.floor(effect("Slider Control")("Slider"));

x+" "

I just delete the %

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 ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

Cleaner way is this, and you can change the number from zero to set decimal places...

effect("Slider Control")("Slider").value.toFixed(0) + "%"

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 ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

If you add an expression to the slider you lose the ability to use the slider in the effects control panel. If you use value.toFixed(0) or Math.round() in the property then the slider will still function in the effects control panel. 

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
New Here ,
Sep 09, 2021 Sep 09, 2021

Copy link to clipboard

Copied

You don't lose the ability to use it if you create your expression around "value".

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
New Here ,
Jan 13, 2021 Jan 13, 2021

Copy link to clipboard

Copied

I resently use this code to create countdown

 

slider = effect("Slider Control")("Slider");

sec = Math.round( slider%60);
min = Math.floor(slider/60);

function addZero(n) {
if (n < 10) return "0" + n else return n;
}

addZero(min) + ":" + addZero(sec);

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
New Here ,
Jan 13, 2021 Jan 13, 2021

Copy link to clipboard

Copied

Change 60 to 59

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