Ok this should be a rather simple problem but I just can't get this right. I have a cumulative sum that's returning a double. These represent percents and it should never be 0.0.. so I figured use d % 1 to keep things under 1. Works fine for 2.13 which becomes 0.13, or 2.98 becomes 0.98, however 3.0 becomes 0.0 not 1.0 (100%)..
I'm obviously doing something fundamentally wrong here? or perhaps I just cheat and say if 0 then 1?
Thanks