Page 1 of 1

Round to nearest tenth

Posted: Mon Nov 17, 2014 10:19 am
by collabxchange
Hi,
I searched the forum but couldn't get any answer. Does anyone know how to round a number to nearest equal to higher tenth.

e.g.

12 --> 20
15 --> 20
1.4 --> 10

Thanks!

Posted: Mon Nov 17, 2014 1:12 pm
by chulett
Hmmm... mod? Mod by 10 and then add the remainer? Decimal values you may need to round up first, me thinks.

Posted: Mon Nov 17, 2014 2:18 pm
by ArndW

Code: Select all

INT((In.Column+10)/10)*10
or

Code: Select all

(10-MOD(In.Column,10))+In.Column
to name just two methods

Posted: Mon Nov 17, 2014 3:45 pm
by FranklinE
I use the "Ceil" mathematical function for decimal values, and you should see good results from this:

Code: Select all

(Ceil(In.column/10))*10