x = (x > 250000 && x < 500000) ? (x / 100) * 10 : ((x > 500000 && x < 1000000) ? (x / 100) * 20 : ((x > 1000000) ? (x / 100) * 30 : x));
Ternary operator of the form (conditional) ? expr1 : expr2
should be read as if conditional then expr1 otherwise expr2
.
solved Ternary operator for comparsion not giving accurate result [closed]