Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5952 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (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 by Guest
Posted

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 )

Posted

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

Posted

: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.

Posted

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 :

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.