SOLVED

FlowBoost Logarithm Operation

Go to solution
Anonymous
Not applicable

FlowBoost Logarithm Operation

For FlowBoost users out there, can you tell me how you've implemented the logarithm operation? Is there such a thing as a FBMath.log function? Or better yet, is there a reference of available function somewhere?

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: FlowBoost Logarithm Operation

Hi Raphael,

Use the built-in JavaScript Math.log10:

var totalScore = FBMath.sum(

  ( {{Company.ENR_Top_100_Design_Build_Firms__c}} ? 5 : 0 ),

  ( {{Company.ENR_Top_150_Global_Design_Firms__c}} ? 5 : 0 ),

  ( {{Company.ENR_Top_200_Environmental_Firms__c}} ? 5 : 0 ),

  Math.log10(1+{{Company.NumberOfEmployees}}) * 5,

  Math.log10(1+{{Company.AnnualRevenue}}) * 3

)

The reason the FBMath.sum extension exists is that JavaScript Math doesn't have an exact equivalent, but for just about every other (and more complex) function it's there in Math.

With the exception of our custom extensions, the FlowBoost library is the native JS function library which is reproduced peerlessly on MDN!

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: FlowBoost Logarithm Operation

Hi Raphael,

Use the built-in JavaScript Math.log10:

var totalScore = FBMath.sum(

  ( {{Company.ENR_Top_100_Design_Build_Firms__c}} ? 5 : 0 ),

  ( {{Company.ENR_Top_150_Global_Design_Firms__c}} ? 5 : 0 ),

  ( {{Company.ENR_Top_200_Environmental_Firms__c}} ? 5 : 0 ),

  Math.log10(1+{{Company.NumberOfEmployees}}) * 5,

  Math.log10(1+{{Company.AnnualRevenue}}) * 3

)

The reason the FBMath.sum extension exists is that JavaScript Math doesn't have an exact equivalent, but for just about every other (and more complex) function it's there in Math.

With the exception of our custom extensions, the FlowBoost library is the native JS function library which is reproduced peerlessly on MDN!