August 3, 200817 yr how do I extract the decimals in a number. I want to convert meters in feet and inches. The result should be in the form: 25'8" First I multiply meters x 3.28 = feet and decimals I have to convert those decimals Decimals x 12/100 To achieve this, I have to extract the decimals. How do I acheive this Thanks benicg Edited August 3, 200817 yr by Guest
August 3, 200817 yr Try: feet = Int ( m * 3.280839895 ) ; inches = Mod ( m * 3.280839895 ; 1 ) * 12 Or: feet = Div ( m ; 0.3048 ) ; inches = Mod ( m ; 0.3048 ) * 39.3700787 Or: in = m * 39.3700787 ; feet = Div ( in ; 12 ) ; inches = Mod ( in ; 12 )
August 4, 200817 yr Author thank you "comment" the first solution does not work; For 1.85 meters=6 feet, the result for inches is .834645 As for the next 2 solutions there is no DIV function in my version of FileMaker. Mine is Ver.6 on Windows XP But I kept on working and found this: Int( meter*3.280839895 )& " ' " & Int(Middle( meter*3.280839895; 3; 2)*12/100) & " '' " The result for 1.85 meters is exactly 6'0" feet. Result for 2 meters=6'6" feet which is the exact answer. thanks again benic
August 4, 200817 yr :idunno: Your profile says version 7, and there is no indication of this question referring to another version (you get this option when you start a thread). Are we supposed to sense this somehow? Anyway, Int ( a / b ) should get you the same result as Div ( a ; b ), at least for positive b. Now, I am reasonably sure that 1 inch equals 2.54 centimeters. 185 centimeters divided by 2.54 is 72.8346457 inches. Click here and you'll see I am not the only one to think so. Hopefully I don't need to explain why 72.8346457 inches are 6 feet and 0.8346457 inches.
August 5, 200817 yr A foot may have different size, depending on country and its unit systems. See http://en.wikipedia.org/wiki/Foot_(length) There were similar problems with different length and weight measures with same name (e.g. "Elle", "Pfund", "pound", "Zentner") in European countries in the 19th century. That's why one should use SI units. Otherwise we will still experience that mars expeditions will fail their aim :
Create an account or sign in to comment