원단위 절사 함수

Function RoundDown(ByVal intParam)
 RoundDown = Int(intParam * 0.1) * 10
End Function 

Response.Write RoundDown(324234) ' 324230
Response.Write RoundDown(23424)  ' 23420
Response.Write RoundDown(3.14)  ' 0 
Response.Write RoundDown(-9999999) ' -10000000
ps : 음수일때와 소숫점일때 주의

댓글