I am trying to make a slider from 0-2000, where 2000 displays as "2000+", encapsulating everything >=2000.
My encoder looks like this:
encoder: function(a) {
a == 2000 ? a = a + '+' : null;
return a;
}
However, this returns false
when a=2000
. I take it this is because a
needs to be an integer, not a string. How can I conditionally add a postfix, then?
null
, and variable assignment, why not:a += a > 2000 ? '+' : '';
? I suspect, but don't have time to verify, that you're effectively returningnull
in every nona == 2000
scenario. - David Thomas+
suffix. - Nina Scholza + '+'
returns false. I am specifically asking how to conditionally suffix something inside the wnumb syntax. - j_d