Format output to four-digit number