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

    (@codepeople)

    Hi,

    There are different modes to hide the decimal places:

    1. Using the rounding operations. The plugin includes different rounding operations:

    – The ROUND operation returns the nearest integer number:

    ROUND(451388.8888888889) = 451389

    – The FLOOR operation returns the previous integer number:

    FLOOR(451388.8888888889) = 451388

    – The CEIL operation returns the next integer number:

    CEIL(451388.8888888889) = 451389

    2. The integer division by 1:

    (451388.8888888889/1)>>0 = 451388

    and that’s all.

    Thank you very much for using our plugin.

    Thread Starter TalibanJoe

    (@talibanjoe)

    Hey codepeople,

    Thanks for your solution!

    And how can I round up a number of hundreds? Example: 451388.8888888889 to 451,400

    Currently I use this code: prec((fieldname6*fieldname7/360),0)

    Thanks for Your help!

    Plugin Author codepeople

    (@codepeople)

    Hi,

    In this case you should use a simple mathematical’s trick, please, modifies the equation as follows:

    (function(){
    var v = fieldname6*fieldname7/360;
    if( v > 1000 ) return ROUND(v/100)*100;
    else return ROUND( V );
    })()

    For example; using your numbers:

    ROUND(451388.8888888889/100)*100 = ROUND(4513.888888888889)*100 = 4514*100 = 451400

    Best regards.

    Thread Starter TalibanJoe

    (@talibanjoe)

    Big Tahnks @ codepeople!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Delete Numbers after Commas in Calculated field’ is closed to new replies.