Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding a MOD9 formula
Message
From
04/09/2012 08:27:31
 
 
To
31/08/2012 16:40:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01552174
Message ID:
01552294
Views:
74
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform