Handle invalid input as 0
Add formatInput method
Remove unnecessary focus() calls in test suite