Why is the value of data-value=\"2.0\"
cast to a String and the value of data-value=\"2.5\"
cast to a Number?
I can handle this fine within my func
By default anything parsed from an attribute will be a string, you will need to convert it to a number if you need to use it as a number. The best way I've been able to handle this is by wrapping it with the Number function (native javascript)
var number = Number($(this).data("value"));