Padding Numbers

The string formatter class isn't available, but you can do it with this trick

// four digit padded random number
var rand = java.util.Random().nextInt(9999) + 10000; // adding 10000 to pad out the INT, then
id += rand.toString().substring(1); // taking the substring to drop the leading '1'
Comments