Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement