Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Convert decimals to fractions

Featured Replies

I am a woodworker trying to make a cutlist for a project. I've been away from FM for a while, so sorry for the beginner-like question.

Using FM7, I'd like to enter data into a field as so (15 1/8) and have it stay that way. I'd, of course, like my calculations to work too!

As an added bonus is it possible to have the option to enter data as a decimal and let FM convert it for me (sometimes it's just easier to enter 15.75 but I don't always remember the decimal values for 1/8's & 1/16's)

A year ago, I probably would have known the answer, but I haven't entered "Layout Mode" in a while.

Thanks.

Bob

Look here:

http://www.fmforums.com/forum/showtopic.php?tid/170725/post/179444/hl/fraction/fromsearch/1/#179444

Here slightly rewritten below to account for integers better, and put a Let wrapper around it.

Let([

integer=Int(number);

numerator=Mod(number;1)

];

Case(integer;integer &" ";"")&

Case(

Int(numerator*64) < 1;"";

Mod(Int(numerator*64);32) = 0; "1/2";

Mod(Int(numerator*64);16) = 0;Div(Int(numerator*64);16) & "/4";

Mod(Int(numerator*64);8) = 0; Div(Int(numerator*64);8) & "/8";

Mod(Int(numerator*64);4) = 0; Div(Int(numerator*64);4) & "/16";

Mod(Int(numerator*64);2) = 0; Div(Int(numerator*64);2) & "/32";

Int(numerator*64) & "/64")

)

Mikhail Edoshin ( http://edoshin.skeletonkey.com/calculating/index.html ) also has a more robust set of CFs that'll provide a more accurate fraction approximation...but it's less useful for woodworking, because it's hard to find 9/11ths on that tape measure...

On top of that, search for "fraction" here in the forums, it's come up before and various solutions offered.

hth

Colin

Edit: if you're really using FM7, you'll prob. want to use a variant of the original written code in the first link. Let [] won't work in 7.

Edited by Guest
added postscript re: FM7

This topic comes up from time to time. I just did a search for [color:blue]+decimals +fractions and it turned up 5 or 6 hits. My reply to one of them mentions a couple of files at DatabasePros.com (link is above in Blue).

HTH

Lee

Yes - though most of referenced solutions attempt to find the closest approximate fraction, which isn't the same as the closest "inch" fraction.

The poster's going to want 1/2, 1/4, 1/8, 1/16, 1/32, or 1/64...and if he's some kind of mastermind woodworker with microscopic power tools, 1/128 or, if he's superhuman, even 1/256.

7/10ths is a probably a more accurate representation of .69375, but it's less useful than 11/16ths for the purpose.

I only point it out because I had to resolve a similar situation (carpentry client) and had a heck of a time finding the solution I point out above on this forum. None of the others ended up being suitable.

I'd like to enter data into a field as so (15 1/8) and have it stay that way. I'd, of course, like my calculations to work too!

You will need to enter your data into a text field. For conversion to decimal (to be used in calculations), you will need to be careful to enter data in a consistent manner.

To convert the text string into a decimal number, you could use something like:

Evaluate ( Substitute ( TextString ; " " ; "+" ) )

Since it seems you will be using only powers of two denominators (i.e. 2, 4, 8, 16, etc.), the conversion from decimal to fraction can be rather simple - see:

http://www.fmforums.com/forum/showtopic.php?tid/152662/

http://www.fmforums.com/forum/showtopic.php?tid/172462/

Let [] won't work in 7.

Of course it will.

Of course it will.

I stand corrected.

  • Author

Thanks for the replies guys... After reading and experimenting with all of your answers (and links to other threads) I found a solution that works perfectly for my application (below).

The only thing that doesn't work is anything that should result in 1/2 shows up as 2/4. All others are correct 3/16, 5/8 etc.. are perfect. 2/4 is the only thing I can't get to result to 1/2.

Sorry for the stupidity. Obviously math isn't my best subject.

Here's the calc

--------------------

Let ( [

fraction = Mod ( Number ; 1 ) ;

sixteenths = Round ( fraction * 16 ; 0 )

] ;

Case ( Int ( Number ) ; Int ( Number) )

&

Case ( Int ( Number ) and sixteenths ; "-" )

&

Case (

sixteenths ; Choose ( Mod ( sixteenths ; 4 ) ;

sixteenths / 4 & "/4" ;

sixteenths & "/16" ;

sixteenths / 2 & "/8" ;

sixteenths & "/16" )

)

)

Thanks again.

Bob

See the second thread I have linked to.

  • Author

Thanks, I didn't see that. That's what I was looking for.

Any ideas what this map represents?

Metric_system.png

  • Author

I see the US (including Alaska & Hawaii), Liberia and Burma, but I can't say I know what it "Represents". But, I love learning new things.

Taking a blind stab at it - countries that actually use english instead of metric measurements?

Colin wins the prize. :yay:

The interesting thing is that the US went decimal for currency (money) very early on: Australia only changed to decimal in 1966. Before that we had the British LSD. I think the UK went to decimal currency in the 1970s (I've got a proof set of the first UK decimal coins somewhere at home that I was given when I was ~10 years old).

The file name kind of gives it away. Anyway, what's your point? Should we all speak Chinese?

"Anyway, what's your point?"

No point at all. :

Better make one up, 'cause that picture is too big to be pointless.

BTW, no country is completely metric: TV screens, computer disks, pipes ...

I've got a proof set of the first UK decimal coins.

Were then named Dewey?

:giggle:

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.