Im trying to convert bytes to kilobytes or megabytes and back again. I have these two functions:
Function DivideTimes(Byval number As Single, iterations As Integer) As Single
Dim x As Integer
For x = 1 to iterations
number /= 1024
Next
Return number
End Function
Function TimesTimes(ByVal number As Single, iterations As Integer) As Single
Dim x As Integer
For x = 1 to iterations
number *= 1024
Next
Return number
End Function
My question is, is there a more efficient way to do these functions? they just seem kinda clunky...
Function DivideTimes(Byval number As Single, iterations As Integer) As Single
Dim x As Integer
For x = 1 to iterations
number /= 1024
Next
Return number
End Function
Function TimesTimes(ByVal number As Single, iterations As Integer) As Single
Dim x As Integer
For x = 1 to iterations
number *= 1024
Next
Return number
End Function
My question is, is there a more efficient way to do these functions? they just seem kinda clunky...