Rjust & zfill not work


I’m trying to add a extra zeros. But traditional methods do not work.

Maybe there is an alternative option?

import streams

test = 5
while True:
    print( str(test).rjust(3,'0') )
    print( str(test).zfill(3) )
    sleep (1000)


hi @trawen
These functions can be easily implemented.
For example :

name  = "string template"
def zfill(num_of_zeros,str):
    result = ('0'*num_of_zeros)+str
    return result

while True:
    print(zfill(8,name))   # print automatically knows where to print!

>>00000000string template