Jump to content

Fractions to Decimals


This topic is 7021 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

Thanks in advance

Link to comment
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.

Link to comment
Share on other sites

This topic is 7021 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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