def add_checksum(isbn) v = 0 (0..8).each { |i| v += isbn[i,1].to_i * (i+1) } v %= 11 checksum = (v == 10 ? 'X' : v.to_s) isbn + checksum end
posted by 増井 at 2:57 PM
Post a Comment
Create a Link
<< Home
View my complete profile
0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home