Quote Originally Posted by paul_nicholls View Post
The bit that is throwing me off is this
Code:
Int(X / Factor) > 0
I suppose it is either 1 or 0 depending on the outcome. Direct conversion would probably be this:
Code:
Result:= (Trunc(X / Factor) - (X / Factor - Ord(Trunc(X / Factor) > 0))) * Factor;