Reputation: 37
How do I get ONLY the last digit from the ui.value of a slider that is two digits long (XX).
I tried this but it does not seem to be acceptable?
var $lastNumber = ui.value.length-1;
Upvotes: 0
Views: 225
Reputation: 11552
Try:
var sliderVal = ui.value;
var $lastNumber = sliderVal.toString().charAt(sliderVal.length-1)
Upvotes: 0