Answer the question
In order to leave comments, you need to log in
How to stop IF slippage in C#?
There is such a code
if (value > 0.5 && value < 0.75);
value = value + onePercent * 150;
if (value > 0.75 && value < 1);
value = value + onePercent * 125;
if (value > 1 && value < 2);
value = value + onePercent * 100;
Answer the question
In order to leave comments, you need to log in
instead of the second and third if use else if
if () {
} else if () {
}
No, no, no, not like this:
if (value > 0.75 && value < 1);
value = value + onePercent * 125;
if (value > 0.75 && value <= 1) {
value = value + onePercent * 125;
}
if (value > 0.75 && value <= 1)
value = value + onePercent * 125;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question