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!
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 ?
Hello!
Actually it should work with several ifs, do you get an error message or something?
Yes and this is what it says as error:
An error ocurred
SyntaxError: expected expression, got keyword ‘if’
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!
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
}
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?