Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding a MOD9 formula
Message
De
04/09/2012 08:27:31
 
 
À
31/08/2012 16:40:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01552174
Message ID:
01552294
Vues:
73
>>I've done one of these before but it was a long time ago and I've since trailed away from VFP. Basically, I need to calculate a check digit using the MOD9 formula:
>>
>>
>>Check Digit = 9 – (Pro – (Int (Pro / 9) * 9))
>
>Are you saying the formula you need bases the checkdigit on the overall string? That's unusual; typically, you have to look at each character in the string and do something. However, if this is what you need, converting the formula you give directly into VFP should work.
>
>* Assume nPro is the value for which you need the check digit
>nCheckDigit = 9 - (nPro - (INT(nPro/9) * 9))
>
>Tamar


Thanks, I think that's similar to the code I edited in my original post... at least it seems to be calculating the check digit properly with the tests I'm doing.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform