Peter1 Posted January 2, 2005 Posted January 2, 2005 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
transpower Posted January 2, 2005 Posted January 2, 2005 Your calculation tests fine, but maybe -Queue- can come up with something shorter.
EasyEdE Posted January 9, 2005 Posted January 9, 2005 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
EasyEdE Posted January 9, 2005 Posted January 9, 2005 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
RalphL Posted January 9, 2005 Posted January 9, 2005 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.
-Queue- Posted January 11, 2005 Posted January 11, 2005 Ed, Evaluate is indeed a new function in version 7.
Recommended Posts
This topic is 7351 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