cancel
Showing results for 
Search instead for 
Did you mean: 

Rounding off to nearest number- SF compensation

Ritanshi
Participant
811

Hello Team,

Can you please help in rounding the value to nearest 10 places. I have already tied implementing below blog given by Xavier. I would like to convert value from 4020 to 4000 .

Tried with formula as:- round(‘halfUp’,round(‘halfUp’,lumpSum)/10)*10. It throws the same value as 4020.

https://blogs.sap.com/2020/09/29/how-to-use-dates-in-formulas-in-compensation-worksheets/

Can you pl help me in validating the formula to convert the value to 4000.

Thanks

Ritanshi

Accepted Solutions (1)

Accepted Solutions (1)

alexandra89
Associate
Associate

Hi Ritanshi,

If you need to convert 4020 to nearest 10, then I guess it would be exactly 4020.

But if you need to convert 4020 to 4000, which is to the nearest thousand, I would write it like that :

round(‘halfUp’, (lumpSum/1000) )*1000

Let me know if it works for you.

Best,

Alexandra

lesleyr
Product and Topic Expert
Product and Topic Expert

4020 to 4000 could also be nearest hundred with round(‘halfUp’, (lumpSum/100) )*100

Answers (1)

Answers (1)

FrantisekHumpal
Explorer

Hello Ritanshi,

If you want to round to the nearest hundred, try following:

round(‘halfUp’, lumpSum/100)*100

  • 4020 will be rounded to 4000
  • 4080 to 4100

If your intention is to round to the nearest ten, than the given example is correct

round(‘halfUp’, lumpSum/10)*10

  • 4020 will be remain 4020
  • 4082 to 4080
  • 4051 to 4050

Hope this helps.

Frank