We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

How to have random number with 4 digit.

Comments

1 comment

  • Avatar
    Adrian Williams

    You can use the randint() function of the Python random module in a Transform node to generate a random integer in the specified range (0 to 9999 in this case). Then, as numbers less than 1000 will have less than four digits (characters), the number is converted to a string and padded with leading '0' characters.

    See the attached example data flow.

     

    Attached files

    Generate Random 4 Digit String - 16 Sept 2021.lna

     

    0
    Comment actions Permalink

Please sign in to leave a comment.