• Resolved loppisinorge

    (@loppisinorge)


    Hi, in fieldname 12 of my calculator, this field will a give number between 0-5. Where a number between:

    5,00 – 4,5 = A 
    4,49 – 3,5 = B 
    3,49 – 2,5 = C 
    2,49 – 1,5 = D 
    1,49 – 1,0 = E 

    How do i easily set it up that once a person get their number is shown in fieldname 12, it also shows the letter within the parameter?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @loppisinorge

    I’ll try to describe the process with a hypothetical example.

    Assuming you have the equation fieldname1+fieldname2, you can edit it as follows:

    (function(){
    var result = fieldname1+fieldname2;
    
    if(4.5<=result) return CONCATENATE(result, ' (A)'); 
    
    if(3.5<=result) return CONCATENATE(result, ' (B)'); 
    if(2.5<=result) return CONCATENATE(result, ' (C)'); 
    if(1.5<=result) return CONCATENATE(result, ' (D)'); 
    if(1<=result) return CONCATENATE(result, ' (E)'); 
    
    })()

    Best regards.

    Thread Starter loppisinorge

    (@loppisinorge)

    I kinda feel stupid. Because i still don’t undertand how to implement your answer. Do you have by any chance, the time make a short video sharing how to implement this? Just a quick step-by-step?

    I would reaally appreciate it!

    Plugin Author codepeople

    (@codepeople)

    Hello @loppisinorge

    The equation is simple. It calculates the numeric result (var result = fieldname1+fieldname2;), and compare it with the lower number of the intervals (4.5, 3.5, 2.5, 1.5, and 1). For example, if the numeric result is greater than or equal to 4.5, the corresponding letter is “A”. The CONCATENATE operation concatenates its parameters, in this case, the number and the A letter enclosed between parentheses:

    if(4.5<=result) return CONCATENATE(result, ' (A)');

    If you need a custom coding service to implement your equations, you can contact us directly via the plugin website:

    https://cff.dwbooster.com/customization

    Best regards.

    Thread Starter loppisinorge

    (@loppisinorge)

    Okay, I managed to get the code implemantet and it works. But it won’t appear on the site? It does however show on the preview..

    Thread Starter loppisinorge

    (@loppisinorge)

    nvm. it is showing now.

    Plugin Author codepeople

    (@codepeople)

    Excellent !!!!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘a number equals an Letter’ is closed to new replies.