October 15, 200124 yr Newbies Ok, I'm sure this is simple, but I am having a hard time coming up with the proper calculation to add feet & inches. Any help would be great.
October 15, 200124 yr Assume fields: Feet1 (number) Inches1(number) Feet2 (number) Inches2 (number) FeetTotal (calculation, number) = Feet1 + Feet2 + Int((Inches1 + Inches2)/12) InchesTotal (calculation, number) = Mod(Inches1 + Inches2, 12) -bd
October 16, 200124 yr Author Newbies To be more specific, I host our local Punt, Pass & Kick in our town and when the scores are measured, they are given as 9.7 for 9 feet 7 inches, so I need to add the three different measurements. Example: 9.7 + 12.8 + 18.3 = 40.6. Regular addition gives you 40.8. Can one of those still work?
October 16, 200124 yr You're going to have to do some fancy text manipulations to work out what part of the string is feet and which part is inches. as long as the value is *always* entered as feet.inches it'll be OK, but I have a feeling that 3 feet might be eneterd as just plain old "3" but that can be worked around. I'll assume the value is entered into the field called "distance" which needs to be a text field, not a number field First check to see if a decimal point has been typed... if not, the the value is feet. Then use the Position() function to locate the position of the decimal point: everything to the left if feet and to the right is inches, add them appropriately. If the text calculation seems difficult, it sure is. I just spent fifteen minutes trying to type it in for you and got about 25% of the way through. It might be easier to get them to convert to metric. <evil grin>
October 17, 200124 yr Author Newbies You were right Vaughan, it took quite a bit of time a manipulating but I finally got it to work. It's not pretty, but it works. Thanks for the suggestions.http://www.fmforums.com/ubb/images/icons/smile.gif
Create an account or sign in to comment