Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get quantity to the next increment of 10? 2

Status
Not open for further replies.

ndp

Programmer
Mar 3, 2003
121
US
Hi,
In my stored procedure, I am getting quantity field which I want to round up to the next increment of ten. If I use ceiling function it increments only to next numeric. For example, If the quantity is 23.3, then I would want it as 30 and if the quantity is 4, I would want it 10.
There might be a simple way to do it, but somehow, I can not think of anything.
Can somebody suggest a way to do it?

Thanks in advance,
ndp
 
You can do it by dividing the result by 10, then use the ceiling function and finally multiply that by 10.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Thanks a lot! That works great! I will give you a star!!
ndp
 
Karl we do think alike. I was going to recommend the exact same thing. :)

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top