Skip to content

Instantly share code, notes, and snippets.

@AlexanderEkdahl
Created October 3, 2013 21:51
Show Gist options
  • Save AlexanderEkdahl/6817690 to your computer and use it in GitHub Desktop.
Save AlexanderEkdahl/6817690 to your computer and use it in GitHub Desktop.
def to_format(number, format = '+XX XXX XX XX XX')
format.gsub(/X/) { number.slice!(0) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment