y u no do it?

Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

Starts at just \$1 per CPM or \$0.10 per CPC.

# Round off number to next 10

Discussion in 'C#' started by eLucknow.com, Aug 20, 2008.

1. #1
it is easy to use round function in asp to round off decimal digit. but how can i round off number (ex 5862) to next 10 (as 5870) using asp.

Aug 20, 2008 IP
2. ### engagerPeon

Messages:
28
0
0
Trophy Points:
0
#2
When I see no pratical solution I do my own function.
try this

function RoundToNextTen(num)
if (num / 10) = CLng(num / 10) then
RoundToNextTen = num
else
RoundToNextTen = (CLng(num / 10) + 1) * 10
end if
end function

Aug 21, 2008 IP
3. ### vihutuoWell-Known Member

Messages:
1,511
34
0
Trophy Points:
130
#3
The simplest way would be this

Private Function RoundToTen(ByVal num)
Return num - (num Mod 10) + 10
End Function

Aug 22, 2008 IP