I am having a strange result.
I'm using Microsoft 365, and W10 both up-to-date.
I have a function I use for rounding up hours worked. Hours are to be rounded to the next 15 minutes, therefore I need to separate the time fraction to compute the rounding.
Function RoundSecurity(ByVal dblHrs As Double) As Double
Dim dblFraction As Double 'Fraction of hours
Dim dblBefore As Double 'Hold area for the incoming hours\
Dim iHrs As Integer
coming in to the Function dblHrs = 10.5
after executing this code
dblBefore = dblHrs
iHrs = Int(dblHrs)
dblFraction = dblBefore = iHrs
dblfraction is = 0 where it should be .5, no?
I know moving dblhrs to dblbefore looks strange, but I did that because when I used dblHrs directly I got the same result.
Help I can't figure this out. Even more confusing, sometimes the answer (dblFraction) comes up as -1