Change leading 0 function to use C-based sprintf

Removes the need for a conditional statement and calls into faster C code.