Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fraction

Featured Replies

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

Michail has threaded these paths:

http://edoshin.skeletonkey.com/2006/01/fraction_approx.html#more

--sd

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 by Guest

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.