14 Replies Latest reply on Dec 14, 2011 4:11 PM by mgores

    Calculation issues

    PageWatkins

      Title

      Calculation issues

      Post

      Hopefully this will be my last post for a while!

       

      It's simple math.  If the Image Size Height in Inches (ISHtIn) is GREATER THAN or equal to 12, subtract 12 from ISHtIn.  If ISHtIn is GREATER THAN or equal to 12, add 1 to ISHtFt.

       

      I've tried MANY different ways, but when the sum comes to 13, the space is blank and so are my feet, but when it comes to 14, the inches show up, but the feet remain blank.

       

      Thanks guys!  Especially Phil.  You've been a HUGE help, man, and I really appreciate it.

        • 1. Re: Calculation issues
          mgores

          what if for ISHtFt

          you used Int(ISHtin/12)

          • 2. Re: Calculation issues
            philmodjunk

            or

            div ( ISHtin ; 12 )

            Also

            Mod ( ISHtin ; 12 )

            Will give you the remaining inches so that if ISHtin = 14

            div ( ISHtin ; 12 ) returns 1 (1 foot)

            and

            mod ( ISHtin ; 12 ) returns 2 ( 2 inches)

             to give you 1 foot 2 inches in place of 14 inches

            • 3. Re: Calculation issues
              PageWatkins

              Allow me to elaborate:

              The main fields of my concern at this point are the Height FT and IN, Width FT and IN, The top and bottom bleed are added to the inches under image size height in inches.

              I only need to get this one calculation right so I can change the field names and do the same thing throughout.  I'm completely new to FMP and databases in general, so you may have to explain what the scripts mean.

              • 4. Re: Calculation issues
                mgores

                Paige,  you don't need to use scripts.  The formulas we were throwing at you can be used as calculations in the field definitions.

                So you would change your definition of  ISHtFt a calculation with div ( ISHtin ; 12 )  as the formula for that calculation

                You can add another field for left over inches with Mod ( ISHtin ; 12 ) as the formula for its calculation

                 

                that way when you enter 14 into the ISHtin field,  a 1 will show up in the ISHtFt field and a 2 will show up in the leftover inch field.

                • 5. Re: Calculation issues
                  PageWatkins

                  Hey Mark! That worked for the remaining inches, but div ( ISHtin ; 12 ) isn't adding the extra foot.

                  • 6. Re: Calculation issues
                    mgores

                    you could add + 1  to the calculation to get the extra foot

                    • 7. Re: Calculation issues
                      philmodjunk

                      Not sure what you mean by "adding the extra foot" here.

                      Remember long division in grade school when you wrote the answer in two parts, the quotient and the remainder?

                      Div returns the quotient and mod returns the remainder.

                      If you divide total inches by 12, Div returns the integer portion of the answer. Thus, Div ( 14 ; 12 ) will return 1.

                      Isn't that what you need here in order to convert 14 inches into 1 ft 2 inches?

                      • 8. Re: Calculation issues
                        PageWatkins

                        In short, when I change the size under height, the Image size in inches changes, but the div ( ISHtin ; 12 ) under the image size in feet isn't returning a + 1 into the field.  Where would I add the + 1 in the calculation?

                        • 9. Re: Calculation issues
                          mgores

                          in the field definition for the ISHft        div ( ISHtin ; 12 ) +1

                           

                          Phil it look like she is setting up a printing thing and would like a 14 in image to have a 2 ft canvas with a 10 in bleed.

                          • 10. Re: Calculation issues
                            PageWatkins

                            actually, the canvas size will be the same as the image size w/ bleed.  the edge to edge will be the finished size which is the Height and Width in the top portion of the previous image. 

                            I'll be using similar calculations the canvas fields.  But even adding the +1 to the calculation isn't returning the + 1.  Since the base height in the image size in ft is the HtFt field, should I put HtFt + 1 in the calculation?  If so, how would that look?

                            • 11. Re: Calculation issues
                              mgores

                              ok I was confused.  You are wanting to correct the image size where it says 23 ft 16 in to say 24 ft 4 in, right?

                              If so we need to get everything into inches so we have (23 *12) + 4 + 5  Then do the Div and Mod to get the correct values for image size.

                              so assuming the upper fields are Htft and Htin

                              the IMHft would be Div(Htft * 12 + (Htin + bleed);12) and IMHin would be Mod(Htft * 12 + (Htin + bleed);12)

                              • 12. Re: Calculation issues
                                philmodjunk

                                I suggest keeping all dimensions in inches for doing your calculations. Then use the div and mod functions to convert total inches into feet and inches strictly for display purposes on your layout. That keeps your calculations simpler.

                                • 13. Re: Calculation issues
                                  PageWatkins

                                  Huzzah!!!  I messed with the calculations and finally got it working after a mix of all of them.

                                  ISHtFt = Div(HtFT * 12 + (HtIn + Bleed_T + Bleed_B);12)

                                  ISHtIn = Mod ( ISHtIn ; 12 )

                                   

                                   

                                  After working on this for over a month I can happily say that I do NOT envy you folks.  I REALLY hope, from the bottom of my heart, that you guys make a great living off of your knowledge.  Thank you all for your help.  I do appreciate it.

                                  • 14. Re: Calculation issues
                                    mgores

                                    Sorry for the confusion I thought you were starting in inches and trying to get feet rather than adding inches to a Foot and a Inch fields