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

## Recommended Posts

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

##### Share on other sites

The Shadow figured this out a while back: Evaluate(fraction).

##### Share on other sites

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)

##### Share on other sites

Try Evaluate(Subsitute(Amt Entered; " "; "+"))

##### Share on other sites

Awesome!

That works great. Thanks

I don' suppose there is any way of reversing that. Meaning changing decimals into fractions, is there?

##### Share on other sites

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.

##### Share on other sites

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

## Create an account

Register a new account