By the way Gordo, I suspect you were having problems using it because the variable d
is a number. The function requires a string. When you're having problems like this the easiest way I've found to see what's going on is to use typeof.
num = '22'
num = 22