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.

Convert script to Filemaker Function

Featured Replies

  • Newbies

Can anyone assist me to convert below script to Filemaker function?

Thanks.

function calcVi(Q1,Q2) {

   var Q3,Q4,Q5,Q6,Q7;

       if ( Q2 >= 2 && Q2 < 4){

      Q3 = 0.827 * Math.pow(Q2,2) + 1.632 * Q2 - 0.181;

      Q4 = 0.3094 * Math.pow(Q2,2) + 0.182 * Q2;

      Q6 = (Q3 + Q4 - Q1) / Q4 * 100;

      }

    if ( Q2 >= 4 && Q2 < 6.1){

      Q3 = -2.6758 * Math.pow(Q2,2) + 96.671 * Q2 - 269.664 * Math.sqrt(Q2) + 215.025;

      Q4 = -7.1955 * Math.pow(Q2,2) + 241.992 * Q2 - 725.478 * Math.sqrt(Q2) + 603.88;

      Q6 = (Q3 + Q4 - Q1) / Q4 * 100;      

      }

    if ( Q2 >= 6.1 && Q2 < 7.2){

      Q3 = 2.32 * Math.pow(Q2,1.5626);

      Q4 = 2.838 * Math.pow(Q2,2) - 27.35 * Q2 + 81.83;

      Q6 = (Q3 + Q4 - Q1) / Q4 * 100;

      }

    if ( Q2 >= 7.2 && Q2 < 12.4){

      Q3 = 0.1922 * Math.pow(Q2,2) + 8.25 * Q2 - 18.728;

      Q4 = 0.5463 * Math.pow(Q2,2) + 2.442 * Q2 - 14.16;

      Q6 = (Q3 + Q4 - Q1) / Q4 * 100;

      }   

    if ( Q2 >= 12.4 && Q2 <= 70){

      Q3 = 1795.2 * Math.pow(Q2,(-2)) + 0.1818 * Math.pow(Q2,2) + 10.357 * Q2 - 54.547;

      Q4 = 0.6995 * Math.pow(Q2,2) - 1.19 * Q2 + 7.6;

      Q6 = (Q3 + Q4 - Q1) / Q4 * 100;

      }  

   if ( Q2 > 70){

      Q3 = 0.1684 * Math.pow(Q2,2) + 11.85 * Q2 -97;

      Q5 = 0.8353 * Math.pow(Q2,2) + 14.67 * Q2 -216;

      Q4 = 0.6669 * Math.pow(Q2,2) + 2.82 * Q2 -119;

      Q6 =(Q5 - Q1) / Q4 * 100;

      }  

  if (Q6 >= 100) {    

    Q7 = ((Math.log(Q3) / Math.log(10)) - (Math.log(Q1) / Math.log (10))) / ( Math.log(Q2)/ Math.log(10)); 

    Q6 = (( Math.pow(10,Q7)-1) / 0.00715 ) + 100;

  }  

  Q6 = parseInt(Q6 + 0.5);  

  return Q6;

  • 2 weeks later...

Create an account or sign in to comment

Important Information

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

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.