switch to total function str.to.int: maps invalid and non-digit strings to 0