Random number for user registering on my site

When someone registers on my site, I want it to automatically assign username. eg. A username followed by 4 random numbers.