shooter69
Expert Member
Hi,
I am calculating a check digit using the Luhn algorithm. How would I put the following in code?
checkdigit = ((sum / 10 + 1) * 10 – sum) % 10
The C++ code is as follows : ((Math.Floor((decimal) sum/10) + 1)*10 - sum)%10;
I am having a problem with the "% 10". what is this and how do I work with it in .net?
http://www.darkcoding.net/credit-card/luhn-formula/
I am calculating a check digit using the Luhn algorithm. How would I put the following in code?
checkdigit = ((sum / 10 + 1) * 10 – sum) % 10
The C++ code is as follows : ((Math.Floor((decimal) sum/10) + 1)*10 - sum)%10;
I am having a problem with the "% 10". what is this and how do I work with it in .net?
http://www.darkcoding.net/credit-card/luhn-formula/
Last edited: