Slobey Posted January 27, 2005 Share Posted January 27, 2005 You guys are so good it scares me. I have another one for you. I have an entry field that allows someone to enter a fraction and I hav another field which turns that into a decimal. Currently the calculation is as follows: Case ( Right (Amt Entered ; 3 )="1/8" ; If (IsEmpty (Left (Amt Entered;Length ( Amt Entered)-3 )) ; .125; I have this same line for every "common" fraction used in my solution. I am trying to make one that will use perhaps a pattern count to find the / and then divide the numerator by the denominator so it will work with whatever fraction entered. This also is needed for a full number and a fraction (3 1/2). Any help would be awsome Thanks in advance Link to comment Share on other sites More sharing options...
transpower Posted January 27, 2005 Share Posted January 27, 2005 The Shadow figured this out a while back: Evaluate(fraction). Link to comment Share on other sites More sharing options...
Slobey Posted January 27, 2005 Author Share Posted January 27, 2005 Thanks, That works great for a single fraction (1/2) but I get a "?" when I use a whole number and a fraction (1 1/2) Link to comment Share on other sites More sharing options...
RalphL Posted January 27, 2005 Share Posted January 27, 2005 Try Evaluate(Subsitute(Amt Entered; " "; "+")) Link to comment Share on other sites More sharing options...
Slobey Posted January 27, 2005 Author Share Posted January 27, 2005 Awesome! That works great. Thanks I don' suppose there is any way of reversing that. Meaning changing decimals into fractions, is there? Link to comment Share on other sites More sharing options...
RalphL Posted January 27, 2005 Share Posted January 27, 2005 I suggest creating a table of decimal to fractions. Use the smallest fraction you want as the starting point and the increment, i.e., 1/16 = .06125, 1/8 = .125, 3/16 = .1875, 1/4 = .25 and so on. Use a lookup to make the conversion, you can make a lookup use the next highest or next lowest value if there is no an exact match. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6628 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