March 19, 200817 yr I have a calculated field..... a fraction The calculation is (Let ( [ test = Mod ( cn_wtu_winter; 1 ) ; denom = Case (test ; 60 ; 15 ) ; numer = Case ( test ; Round ( cn_wtu_winter * 4 ; 0 ) ; cn_wtu_winter) ] ; numer & "/" & denom ) I need to create a new field (easy peezy).... but this field should be the lowest demonitator fraction. So instead of 3/15 the new field should read 1/5. Any advice? Thanks in advance
March 19, 200817 yr Michail has threaded these paths: http://edoshin.skeletonkey.com/2006/01/fraction_approx.html#more --sd
March 19, 200817 yr I was just about to post that link! Add that custom function and change your calc to something like... Let ( [ test = Mod ( cn_wtu_winter; 1 ) ; denom1 = Case (test ; 60 ; 15 ) ; numer1 = Case ( test ; Round ( cn_wtu_winter * 4 ; 0 ) ; cn_wtu_winter) smaller = Min(denom1; numer1); greater = Max(denom1; numer1); factor = GCD(smaller; greater); numer = numer1/factor; denom = denom1/factor ] ; numer & "/" & denom ) PS: It makes a bit more sense to modify the CF by adding the Min(), Max() bit in there instead of in your calc. Edited March 19, 200817 yr by Guest
Create an account or sign in to comment