Skip to main content
Known Participant
August 10, 2022
Answered

Convert 1000 to 1,000

  • August 10, 2022
  • 1 reply
  • 451 views

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

This topic has been closed for replies.
Correct answer Dan Ebberts

Try this:

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

1 reply

Mylenium
Legend
August 10, 2022

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

Known Participant
August 10, 2022

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 🙂

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
August 10, 2022

Try this:

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