![]() Import static ĪssertEquals( false, Validate. 18 (modulus) 10 => 8, which is not equal to 0, so this is not a valid credit card number If the remainder equals zero, the original credit card number is valid. Finally, take that sum and divide it by 10.Sum all of the final digits: => 8 + 9 + 1 = 18.Supports Visa, MasterCard, American Express, Diners Club, Discover and JCB Taken from. If a resulting number is greater than 9, replace it with the sum of its own digits (which is the same as subtracting 9 from it): => => or: => => Validates Credit Card Numbers of different type. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |