Simple I hope - converting feet/inches to decimal

  • Thread starter Thread starter JayT
  • Start date Start date
J

JayT

Guest
Hi - I am writing a small form that has a calculated field. I want to convert feet and inches in length to metres, and vice versa - so user inputs 10.45 metres, and I will have two fields giving the answer (I suppose) - one with the whole numbers before the decimal place (the feet); the other taking just the numbers after the decimal and converting them from /10 to /12 for inches. Think I can work out the reverse if anyone has a nifty way of doing this - thanks very much; I'm new to this site.

J
 
from meters to feet

10.45 * 3.281 (feet per meter) = 34.28645 feet

take the remainder and * by 12 to give you inches i.e.

0.28645 * 12 = 3.4374 inches

therefore 10.45 meters = 34 feet and 3.4374 inches

double check the conversion factor of 3.281, I'm sure its right but I going from my memory of school days.

Allan
 
A little more...

Thanks Allan

My maths was OK, I just don;t know how to 'take the remainder' from a returned value... any help on this?

Jay
 
This is my conversion from meters to Feet and Inches..

The formula below returns the result of two fields Length [SizeL] and Width [SizeW] where [SizeL] is the length in metres and [SizeW] is the width in metres.

Set the control source of a text box to.

=CInt(([SizeL]*39.344)-([SizeL]*39.344 Mod 12))/12 & "ft " & ([SizeL]*39.344 Mod 12) & "ins x " & CInt(([SizeW]*39.344)-([SizeW]*39.344 Mod 12))/12 & "ft " & ([SizeW]*39.344 Mod 12) & "ins"

Important
Don't use 'Width' or 'Length' as the names of fields that hold your dimensions because 'Width' is an Access reserved word and 'length' probably is too.

Hope someone finds this useful.
 

Users who are viewing this thread

Back
Top Bottom