function for splitting integers

this function splits an integer into smaller values