Copy link to clipboard
Hi, I'm trying to use code from @Thom Parker tutorial:
But instead of 4 digit number I get only "d", what am I doing wrong?
Here is code I just copy/paste it, I didn't change anything:
var strDate = "3/20/2006"; // Starting Datevar strFirstPart = strDate.split("/").join("");var nSecondPart = Math.random()*10000;var strRegNum = util.printf("ID%s-d", strFirstPart, nSecondPart);
Try add % before d, like this:
Thank you that fixed it.
In tutorial it says Il get 4 digit number but sometimes I get 3 digits, How to only get 4 digits every time?