gbenic Posted August 3, 2008 Posted August 3, 2008 (edited) 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, 2008 by Guest
comment Posted August 3, 2008 Posted August 3, 2008 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 )
gbenic Posted August 4, 2008 Author Posted August 4, 2008 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
comment Posted August 4, 2008 Posted August 4, 2008 :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.
Martin Brändle Posted August 5, 2008 Posted August 5, 2008 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 :
comment Posted August 5, 2008 Posted August 5, 2008 For crying out loud: he said version 6 - not the 19th century!
Recommended Posts
This topic is 5952 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now