[fix] always return number on error to prevent calculation on undefined