change the weight and size of text using expression

Moderators: Disciple, zlovatt

Post Reply
rajat.saga
Posts: 1
Joined: September 23rd, 2021, 4:07 am

Hey everyone,
I am trying to create timer using slider and expression. but its taking default format 00m 00s (where m and s stand for minute and second respectively). I want to change the size and weight of character 'm' and 's'.

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

seconds = Math.floor(slider%60);
minutes = Math.floor(slider/60);

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

if (slider > 0) {
addZero(minutes) + "m " + addZero(seconds)+ "s"
} else {
"0m 0s"
}

Post Reply