3
var iniciaEm = 0;
var terminaEm = 20;
var variacao = 0.1;
var s = "";
var str = "";
for(var i =iniciaEm; i<=terminaEm; i=i+variacao){
str += i;
s += "<option value=\""+i+"%\">"+i+"%</option>";
}
$("#teste").append(s);
// retorno:
0
0.1
0.2
0.30000000000000004
0.4
0.5
0.6
0.7
0.7999999999999999
0.8999999999999999
0.9999999999999999
1.0999999999999999
would like the values to vary with each 0,1
, what’s wrong with my code?
follow the jsFiddle: https://jsfiddle.net/7wx1t5yb/