how to make a Ejs way to recognize that a number is 10,100,1000 etc

if
number is 1000 to 9999 , how to display 1000 ?

so if a number is 100 to 999, how to display 100 ?

if the number is 10 to 99, how to display 10

number 0 to 9 display as 1 ?

thanks!