I am looking to pad a string with random numbers to meet a certain length (i.e. 10 characters). For example:
HAM --> HAM3481259 or TURKEY --> TURKEY6324
I've tried some JavaScript functions but I either had too many or no numbers at all. Any suggestions would be greatly appreciated.
10 - str.length(or10 - (str.length % 10)after checking ifstr.length % 10 > 0).