get first 4 digits of a number javascript