README.md
December 5, 2022 ยท View on GitHub
Description
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.
More Info
| Submitted On | |
| By | Jacky Wong |
| Level | Beginner |
| User Rating | 4.3 (13 globes from 3 users) |
| Compatibility | VB 6.0 |
| Category | Math/ Dates |
| World | Visual Basic |
| Archive File |
Source Code
Public Function AdvRound(InValue As Double, InDecimal As Integer) As Double
Dim lDblProcess As Double
lDblProcess = InValue * (10 ^ InDecimal)
AdvRound = Int(lDblProcess + 0.5) / (10 ^ InDecimal)
End Function
Public Function AdvCeil(InValue As Double, InDecimal As Integer) As Double
Dim lDblProcess As Double
lDblProcess = InValue * (10 ^ InDecimal)
If Int(lDblProcess) < lDblProcess Then
lDblProcess = Int(lDblProcess) + 1
Else
lDblProcess = Int(lDblProcess)
End If
AdvCeil = lDblProcess / (10 ^ InDecimal)
End Function
Public Function AdvFloor(InValue As Double, InDecimal As Integer) As Double
Dim lDblProcess As Double
lDblProcess = InValue * (10 ^ InDecimal)
AdvFloor = Int(lDblProcess) / (10 ^ InDecimal)
End Function