in reply to Summing the odd/even digits of a larger number (for upc check digits)...a better way?
local $_ = $code; $check = tr/1/1/ + 6*tr/2/2/ + tr/3/3/ + 12*tr/4/4/ + tr/5/5/ + 18*tr/6/6/ + tr/7/7/ + 24*tr/8/8/ + tr/9/9/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Summing the odd/even digits of a larger number (for upc check digits)...a better way?
by sgifford (Prior) on Jun 23, 2006 at 15:38 UTC |