Need to output to be in 5s
TC
Posts: 1,019
I am trying to figure the best way to take a value and change it into steps of 5s. For example:
Starting value : what I want
4 : 0
6 : 5
11 : 5
12 : 10
24 : 20
26 : 25
I hope this makes sense.
Thanks
TC
Starting value : what I want
4 : 0
6 : 5
11 : 5
12 : 10
24 : 20
26 : 25
I hope this makes sense.
Thanks
TC
Comments
Yep, like that. I never thought of that, still learning. Thanks.
If so then what CG just wrote would work. An alternative way would be:
My code is shorter, does that mean I win?
OOPS, Yes, it should be 11 : 10
I like yours, but ChrisGadd's is easier for me to understand what is going on.
That was one of my ideas, but how would would I do that? the value would be anywhere from 0 to 50, but I only care about steps of 5.