• Resolved lionelwriter

    (@lionelwriter)


    Hello !

    I would like to round the number of digits after a comma. Some results showed too much digits after a comma, is there a way to fix it please ?

    THank you

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Yes, there is a common action called Round Amount which does exacly that. More about common actions here:https://sfmanual.rednao.com/documentation/calculatedfields/common-actions-in-formulas/

    Hope this helps but if it doesn’t please let me know!

    Thread Starter lionelwriter

    (@lionelwriter)

    Thank you so much for your help. But i have one little more problem. THis action doen’t work with several if condition. How can i format it please ?

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Actually it should work with several ifs, do you get an error message or something?

    Thread Starter lionelwriter

    (@lionelwriter)

    Yes and this is what it says as error:

    An error ocurred
    SyntaxError: expected expression, got keyword ‘if’

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Could you copy and paste the formula that is having this issue? I checked the formulas in your form but couldn’t find the one that is having this error.

    Regards!

    Thread Starter lionelwriter

    (@lionelwriter)

    Yes for sure. This is it :

    if(salaire annuel<=60000)
    {
    return salaire annuel*0
    }
    if(salaire annuel<=240000)
    {
    return (salaire annuel-60000)*10/100/12
    }
    if(salaire annuel<=480000)
    {
    return (18000+(salaire annuel-240000)*15/100)/12
    }
    if(salaire annuel<=1000000)
    {
    return (54000+(salaire annuel-480000)*25/100)/12
    }
    if(salaire annuel>1000000)
    {
    return (184000+(salaire annuel-1000000)*30/100)/12
    }

    Plugin Author EDGARROJAS

    (@edgarrojas)

    Got it, adding the rounding after the return statement should work fine. something like this:

    if(salaire annuel<=60000)
    {
    return RNFRound(salaire annuel*0,2);
    }
    if(salaire annuel<=240000)
    {
    return RNFRound((salaire annuel-60000)*10/100/12,2);
    }
    if(salaire annuel<=480000)
    {
    return RNFRound((18000+(salaire annuel-240000)*15/100)/12,2);
    }
    if(salaire annuel<=1000000)
    {
    return RNFRound((54000+(salaire annuel-480000)*25/100)/12,2);
    }
    if(salaire annuel>1000000)
    {
    return RNFRound((184000+(salaire annuel-1000000)*30/100)/12,2);
    }

    Could you try it please?

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

The topic ‘Round digits after a comma’ is closed to new replies.