Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to round off to next 10 in oracle?

I need to find the next 10 digit number in a query.

I try to use round(n,-1) but it rounds off to nearest 10 digit but I need next 10 digit.

Please help me.

select round(5834.6,-1) from dual

gives 5830 but i need 5840

like image 337
MKN Avatar asked Jul 22 '13 14:07

MKN


2 Answers

select ceil(5834.6/10)*10 from dual
like image 155
Sebas Avatar answered Oct 15 '22 17:10

Sebas


Then add "5":

select round(5834.6 + 5,-1) from dual
like image 30
Gordon Linoff Avatar answered Oct 15 '22 17:10

Gordon Linoff