Skip to content

Commit

Permalink
Use even?
Browse files Browse the repository at this point in the history
  • Loading branch information
jremes-foss authored and stympy committed Sep 8, 2016
1 parent f140e9f commit 5e23fa5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/faker/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def luhn_algorithm(number)
multiplications = []

number.split(//).each_with_index do |digit, i|
if i % 2 == 0
multiplications << digit.to_i * 2
else
multiplications << digit.to_i
end
if i.even?
multiplications << digit.to_i * 2
else
multiplications << digit.to_i
end
end

sum = 0

Expand Down

0 comments on commit 5e23fa5

Please sign in to comment.