Convert 1000 to 1,000

Community Beginner ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Hi guys,

 

I guess this is very simple to do but I can't figure out how to do it...

I would need to set the 'Source Text' to a thousand separator (either "," or ".")

 

I know for removing decimals, this expression works fine:

Math.round()

 

My source text is linked to a 'Slider' all good until there, so if I write 1000, how can I make it to be shown 1,000 or 1.000?

 

 

Thank you! 

Liss

TOPICS
Expressions , FAQ , How to

Views

32

Likes

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

Community Expert , Aug 10, 2022 Aug 10, 2022

Try this:

s = effect("Slider Control")("Slider").value;
s.toLocaleString()

Likes

Translate

Translate
Community Expert ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

All you're ever going to need (the techiques, not necessarily the specific code, that is):

 

http://www.motionscript.com/design-guide/counter.html

 

Mylenium

Likes

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 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Hi!

 

Thank you for sending the link, but is too complex for what I need... I also have set the duration and timing with keyframes linked to few other numbers (so I can't really use the code, is not working without the "beginCount; endCount; dur"

 

I tried removing part of the code and make some adjustments but, for now, is not working.

Will keep trying, please if you know any other easier way to do it, I will be more than happy to try it!

 

 

Thanks again 🙂

Likes

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 ,
Aug 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

Try this:

s = effect("Slider Control")("Slider").value;
s.toLocaleString()

Likes

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 10, 2022 Aug 10, 2022

Copy link to clipboard

Copied

LATEST

That worked!

Awesome, thank you very much!

Likes

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