Skip to content

Commit

Permalink
wiki: jekyll-ppi: Use map(&:to_i)
Browse files Browse the repository at this point in the history
Change-Id: Ie26371d43cc37f5b449b730aa4da5e5e684aceeb
  • Loading branch information
luk1337 committed Aug 15, 2024
1 parent 8803957 commit 1a90dbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _plugins/jekyll-ppi.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Jekyll
module PPI
def ppi(input, screen_size)
h, w = input.split("x")
("%d" % (Math.sqrt((h.to_i ** 2) + (w.to_i ** 2)) / screen_size))
h, w = input.split("x").map(&:to_i)
("%d" % (Math.sqrt((h ** 2) + (w ** 2)) / screen_size))
end
end
end
Expand Down

0 comments on commit 1a90dbd

Please sign in to comment.