• Resolved aaronwessex

    (@aaronwessex)


    Hi,

    i am trying to do a calculation using round and this is the formula i need to do:

    add L and R = 6.5+6.0 = 12.5 /2 = 6.25
    Now subtract – 0.5 for all ‘other’ countries = 5.75
    Now round up to 6.0

    at moment i have: round(((%listening%+%reading%)/2)*2) /2

    and the php version i ccreated which works is this to give you an idea ??

    Just to give you an example:

    <?php
    $listening = 6.5;
    $reading = 7;
    $writingadd = $listening + $reading;
    $writingdiv = $writingadd / 2;
    $writingmin = $writingdiv – 0.8;
    $writing = round($writingmin * 2) / 2;
    $speaking = $listening;
    $totaladd = $listening + $reading + $writing + $speaking;
    $totaldiv = $totaladd / 4;
    $totalround = round($totaldiv * 2) / 2;
    //echo ‘<br>Est. Overall: ‘ . $totalround;
    $tround = 7.0;
    $gap = $tround – $totalround;
    ?>

    but trying to do it in Caldera Forms, as it be better ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor christiechirinos

    (@christiechirinos)

    Hi Aaron,

    Thanks for using Caldera Forms, we’re glad you’re finding it useful. ?? I’m not sure what your question is here – are you asking if this is possible? It is absolutely possible with the formula you outlined at the top. I would recommend taking a look at our documentation about manual formulas and calculation fields here: https://calderaforms.com/doc/calculation-fields/

    I hope this helps!

    Thread Starter aaronwessex

    (@aaronwessex)

    Would you be able to give us an example of using the “Round” function in formula?

    Thanks
    Aaron

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Advanced Calculation using round()’ is closed to new replies.