• This is a great plugin. Exceptional. Might need some work on the look of the front-end templates

    I wanted to use the ceiling function but instead of rounding up to the next integer I want to round up 0.5 so for example 1.2 will read 1.5 and not 2. Anyone know how best to do this???

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    Please, post the questions in the support page to allow the other users can access to the solutions easily.

    I’ll assume that the field is the fieldame1. So, in this case, a possible solution would be:

    (function(){
    var v = fieldname1;
    if(ROUND(v)<v) return ROUND(v)+0.5;
    else return ROUND(v);
    })()

    I will execute the previous formula with the values: 1.2, and 1.6 to allow you understand the process.

    ROUND(1.2) is 1

    as 1 < 1.2 the return of the formula would be: 1+0.5 = 1.5

    Now, with 1.6

    ROUND(1.6) = 2

    but 2 > 1.2, so, in this case the formula will return 2

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Great Claculator’ is closed to new replies.