Im getting some problems while trying to create my own mod function as the built in one doesnt allow for decimals and rounds the figure.
I had something put together i though would work but when it gets to this point in the calculation it throws an error.
Below is what i tried in the immediate window
the answer i get to this is
4.49999999999999E-02
rather then the 0.045 i would have expected.
Any help appreciated
Code:
Function KPMod(vNewMainVal, vNo)
Do Until vNewMainVal < vNo
vNewMainVal = (vNewMainVal - vNo)
Loop
KPMod = vNewMainVal
End Function
I had something put together i though would work but when it gets to this point in the calculation it throws an error.
Below is what i tried in the immediate window
Code:
?1.045 = 1
the answer i get to this is
4.49999999999999E-02
rather then the 0.045 i would have expected.
Any help appreciated