Skip to content

Instantly share code, notes, and snippets.

/.rb Secret

Created February 24, 2015 20:08
Show Gist options
  • Save anonymous/c733de2475b1604eb59e to your computer and use it in GitHub Desktop.
Save anonymous/c733de2475b1604eb59e to your computer and use it in GitHub Desktop.
def converted_dimensions(width, height)
result = format_length(*width.divmod(12))
result << " x "
result << format_length(*height.divmod(12))
end
def format_length(ft,inches)
result = ""
result = "#{ft.to_i}' " if ft > 0
result = "#{result}#{inches}\""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment