Using Clamp on Text and make it numbers (only)

Hello,
I’m working on widget and I wanted to clamp the total entered characters to 4 and i managed to do so.
But I had another problem and I wanted to make the input Numbers Only and I also managed to do that but as a separate code… now i want to merge both in one code so when the user start inputting characters it will be numbers only + max 4 numbers.
I’ll take another method if there’s one

here’s the code:

This seems to work:

1 Like

works just fine, thanks!