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

Exression for number counter with math.round and adding spaces?

Community Beginner ,
Aug 25, 2021 Aug 25, 2021

I have this so far:

startT = 0;
endT = 1;
beginVal = 0;
endVal = 3766;
t = linear(time,startT,endT,beginVal,endVal);
t += "";
t.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");

 

Im getthing this in between the two numbers:

Screenshot 2021-08-25 at 14.59.33.pngexpand image

How do I add math.round to this expression to just see nombers without any decimals?

 

TOPICS
Expressions , How to
3.4K
Translate
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 Beginner , Aug 25, 2021 Aug 25, 2021

I found it a minute later on a video linked below

 

I just parented slider control to my source text.

 

num = effect("Slider Control")("Slider").value.toFixed();
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
addCommas(num);

 

https://www.youtube.com/watch?v=EfoHlj0CKes&t=134s

 

Translate
Community Beginner ,
Aug 25, 2021 Aug 25, 2021
LATEST

I found it a minute later on a video linked below

 

I just parented slider control to my source text.

 

num = effect("Slider Control")("Slider").value.toFixed();
function addCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
addCommas(num);

 

https://www.youtube.com/watch?v=EfoHlj0CKes&t=134s

 

Translate
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