14 Replies Latest reply on Feb 26, 2010 5:13 PM by dekade

# Decimal Calculation Not Working Right

### Title

Decimal Calculation Not Working Right

### Post

I thought this was simple but it evidently involves a function I'm not aware of.

1     Field "A" has returned a value of 12.875 inches

2     Field "B" represents that 3 inches goes into 12.875 inches a number of  4.2917 times

3     Field "C" needs to show how many inches of 3 inches does the .2917 represent?

I can't get it figured out via Filemaker means. No problem as a general math issue. I just can't get FM to do it correctly.

• ###### 1. Re: Decimal Calculation Not Working Right

Try this formula for C:

Mod(A;3) * 3

• ###### 2. Re: Decimal Calculation Not Working Right

Field "C" needs to show how many inches of 3 inches does the .2917 represent?

I am not sure what you mean by "how many inches of 3 inches"? If you start with 12.875 and divide it by 3, you get 4 and something. If you're only using full 3-inch pieces, that's 4 pieces times 3 inches - and you're left with 0.875 inches unused.

Short version:

Div ( 12.875 ; 3 ) = 4

Mod ( 12.875 ; 3 ) = .875

• ###### 3. Re: Decimal Calculation Not Working Right

Comment:

Please slowly read my original post again to clear up your confusion. You will see exactly where I am coming from and going. If you take .2917 of 3" then how many inches is the .2917?

I just tried Jade's and it does not work.

• ###### 4. Re: Decimal Calculation Not Working Right

That did not work either.

Here is the core issue - If you take .2917 of 3" then how many inches is the .2917?

• ###### 5. Re: Decimal Calculation Not Working Right

I thought this was simple but it evidently involves a function I'm not aware of.

1     Field "A" has returned a value of 12.875 inches

2     Field "B" represents that 3 inches goes into 12.875 inches a number of  4.2917 times

3     Field "C" needs to show how many inches of 3 inches does the .2917 represent?

I can't get it figured out via Filemaker means. No problem as a general math issue. I just can't get FM to do it correctly.

Here is the core issue - If you take .2917 of 3" then how many inches is the .2917?

• ###### 6. Re: Decimal Calculation Not Working Right

12.875 inches / 3  = 4.2917 inches.

How many inches is .2917 inches? It's 0.2917 inches.

I don't think that's what you have in mind here. Do you want to approximate standard fractions of an inch? If so, to how small a fraction do you want to approximate your result? 4ths, 8ths, 16ths... or ?

• ###### 7. Re: Decimal Calculation Not Working Right

Phil:

Take 3".     Now - how many inches is the fraction .2917 of the 3"? IF the decimal were .25 instead of .2917 the answer would be .75 inches. See where i'm going?

Thus back to my original post for the process. I know this is wierd but it is of value to me. There must be someway for FM to make this work.

I need to be able to take the last 4 decimal places and determine how many inches of 3 inches those 4 decimal place represent.

• ###### 8. Re: Decimal Calculation Not Working Right

Not really. 1 inch - 0.25 = 0.75 inches, but you are asking about 3 inches. Wouldn't that be 2.75 inches, applying your 2nd example?

1     Field "A" has returned a value of 12.875 inches

2     Field "B" represents that 3 inches goes into 12.875 inches a number of  4.2917 times

3     Field "C" needs to show how many inches of 3 inches does the .2917 represent?

Using your numbers, B represents a 12.875 inch item that has been dvided into 3 pieces of equal length. One such piece would be approximately 4.2917 inches in length. Thus, the "3 inches" you refer to in step 3 doesn't make any sense to me.

• ###### 9. Re: Decimal Calculation Not Working Right

Oh my gosh. I just realized that I am not making sense. I am very sorry to everyone.

I am wanting to see how many times 3 goes into the whole number to the left of the decimal.

Lets say that the number is 23.6675. 3 goes into that 7 times and there is a remainder of 2.6675 inches leftover. THAT's waht I need a calculation for. I need to see the 2.6675 end up in Field "C".

Again I am very sorry. It was all my mistake.

• ###### 10. Re: Decimal Calculation Not Working Right

I was about to post a guess to that effect!

1     Field "A" has returned a value of 12.875 inches

2     Field "B" represents that 3 inches goes into 12.875 inches a number of  4.2917 times

3     Field "C" needs to show how many inches of 3 inches does the .2917 represent?

Line 2 has an error in it and that's what's taking us off course here.

with a 12.875 inch item, figuring out how many 3 inch pieces is 12.875 Mod 3 which gives you .875 inches as the size of the piece left over.

Thus Mod ( A ; B ) will compute the remainder for you in a filemaker calculation.

• ###### 11. Re: Decimal Calculation Not Working Right

Hang on I'm gonna try it right now.

• ###### 12. Re: Decimal Calculation Not Working Right

Please assume I have read your post carefully before replying. The phrase "how many inches of 3 inches" is meaningless (it's not even good English) and requires clarification. Repetition is not clarification.

Now, the number 0.2917 (actually 0.291666...) represents the fraction of a 3-inch piece that's left after the division and as such it s length in inches is 3 * 0.2917 = 0.875 - which is exactly the result of Mod ( 12.875 ; 3  ) that I suggested earlier.

• ###### 13. Re: Decimal Calculation Not Working Right

Hot Dog!!!

That did it! Nothing like going at it the long way, huh? Thanks Phil. It was definitely a brain freeze. This post is solved!

• ###### 14. Re: Decimal Calculation Not Working Right

Sorry Comment,

It was my fault all the way along. Too many long hours I guess. Sorry again.