Hi People,
I have the function below that rounds up or down . Code works fine, but i want to be clear in my head of what the function is actually doing?.
Public Function MyRound(Byval YourNumber as Double, Places as Integer)as Double
Myround = Yournumber * (10 ^ Places) Not sure about this ?
MyRound = MyRound + 0.5 ' This Adds 0.5
MyRound = Int(MyRound) ' This Converts To Integer whole No
MyRound = MyRound / (10 ^ Places) ' Not Sure about this?
can somebody explain the one's i have marked , what is the code specifially doing?.
Thanks In advance for Any Help Here!
I have the function below that rounds up or down . Code works fine, but i want to be clear in my head of what the function is actually doing?.
Public Function MyRound(Byval YourNumber as Double, Places as Integer)as Double
Myround = Yournumber * (10 ^ Places) Not sure about this ?
MyRound = MyRound + 0.5 ' This Adds 0.5
MyRound = Int(MyRound) ' This Converts To Integer whole No
MyRound = MyRound / (10 ^ Places) ' Not Sure about this?
can somebody explain the one's i have marked , what is the code specifially doing?.
Thanks In advance for Any Help Here!