Rounding off differently, how I can it make........
Hi All
someone know how i can to round my values however when they have already value after comma larger from 0,2.
e.g.
normally rounded off : 5,44 to 5,00 | 6,67 to 7,00 | 1,53 to 2 etc, etc
I want to make: 2,23 to 3,00 | 5,17 to 5,00 | 1,28 to 2,00 etc, etc
hope, that this comprehensible what I want
So, how it make? thanks in advance
Re: Rounding off differently, how I can it make........
vb Code:
Public Function roundDown(dblValue As Double) As Double
On Error GoTo PROC_ERR
Dim myDec As Long
myDec = InStr(1, CStr(dblValue), ".", vbTextCompare)
If myDec > 0 Then
roundDown = CDbl(Left(CStr(dblValue), myDec))
Else
roundDown = dblValue
End If
PROC_EXIT:
Exit Function
PROC_ERR:
MsgBox Err.Description, vbInformation, "Round Down"
End Function
Public Function roundUp(dblValue As Double) As Double
On Error GoTo PROC_ERR
Dim myDec As Long
myDec = InStr(1, CStr(dblValue), ".", vbTextCompare)
If myDec > 0 Then
roundUp = CDbl(Left(CStr(dblValue), myDec)) + 1
Else
roundUp = dblValue
End If
PROC_EXIT:
Exit Function
PROC_ERR:
MsgBox Err.Description, vbInformation, "Round Up"
End Function
Re: Rounding off differently, how I can it make........
How about this:
dblValue=dblValue + 0.3
Round as normal