Skip to content

Instantly share code, notes, and snippets.

@rjp
Created October 19, 2009 22:19
Show Gist options
  • Save rjp/213777 to your computer and use it in GitHub Desktop.
Save rjp/213777 to your computer and use it in GitHub Desktop.
class String
alias :old_to_i :to_i
def to_i
x = self.old_to_i
if x == 0 then # maybe it didn't parse
return self.hex
end
return x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment