Perhaps I misunderstood the original requirement. I assumed that the actual requirement was for percentage to end up with a value of either 0 or 1. The original code in the first post would do that for integer values but not doubles. It would leave it unchanged for the values from 0 to 0.99999.... That is why I asked for clarification in post #2.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.