Round, Ceiling, Floor Function
I found the round function from the planet source code before and I grouped it with my own ceil and floor function together. I hope these could help someone who don't want to use the round and format function to handle the numeric information.
AI
AI 요약: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
소스 코드
Public Function AdvRound(InValue As Double, InDecimal As Integer) As Double <br>
Dim lDblProcess As Double <br>
<br>
lDblProcess = InValue * (10 ^ InDecimal) <br>
AdvRound = Int(lDblProcess + 0.5) / (10 ^ InDecimal) <br>
End Function <br>
<br>
Public Function AdvCeil(InValue As Double, InDecimal As Integer) As Double <br>
Dim lDblProcess As Double <br>
lDblProcess = InValue * (10 ^ InDecimal) <br>
If Int(lDblProcess) < lDblProcess Then <br>
lDblProcess = Int(lDblProcess) + 1 <br>
Else <br>
lDblProcess = Int(lDblProcess) <br>
End If <br>
AdvCeil = lDblProcess / (10 ^ InDecimal) <br>
End Function <br>
<br>
Public Function AdvFloor(InValue As Double, InDecimal As Integer) As Double <br>
Dim lDblProcess As Double <br>
lDblProcess = InValue * (10 ^ InDecimal) <br>
AdvFloor = Int(lDblProcess) / (10 ^ InDecimal) <br>
End Function <br>
원본 댓글 (3)
Wayback Machine에서 복구됨