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.

Fraction to Number

Featured Replies

I have a sales database where users enter the advert size as a fraction. The entry could be, for example: 1/2 or 1/16 or 1. To convert the fraction to a number the most efficient calculation I can think of is:

If( PatternCount ( SizeFraction ; "/" ) > 0 ; LeftWords(Substitute ( SizeFraction ; "/" ; " " ); 1) / RightWords(Substitute ( SizeFraction ; "/" ; " " ); 1) ; SizeFraction)

Is this the most efficient method, or does anyone know of a simpler calculation?

Note: 1/2 is 1 word (in Filemaker 5 it was 2 words). Fractions and decimal entries can be entered in the SizeFraction field (eg: 0.5 or 1/2 will produce the result 0.5)

Thanks - Peter

Your calculation tests fine, but maybe -Queue- can come up with something shorter.

The calculation:

  • Author

Thanks! That really is simpler. Peter

The Shadow: Thanks, super neat.

Am I correct in that the Evaluate function is new in FM7? I'm using FM6 and can't find it. Also is there a straight forward way to display a decimal as a fraction, ie 1.625 as 1 5/8? I'm converting fractions to decimals and decimals to fractions but the code involved is tedious at best. I originally had my work set up in Excel and it handles fractions and decimals in the same field without a hitch. I've converted the file over to FM so I can do MUCH more with the info EXCEPT the decimal/fraction issue.

TIA for any feedback.

Ed

Did another archive search and found Shadow's response using the Choose function to display proper fractions - I'll give that a try. My question re the Evaluate function still stands.

Thanks,

Ed

Another method would be to make a table of decimal & fraction equivalants. Use a lookup to get the conversion. With a lookup you can choose to go to the next higher or next lower value if there is not an exact match.

Ed, Evaluate is indeed a new function in version 7.

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.