Quantcast
Channel: User Just code - Stack Overflow
Viewing all articles
Browse latest Browse all 41

Answer by Just code for Javascript dropdown options 0-100 increment by .5

$
0
0

You can just increment the i by 0.5 and you will get your expected output, there is no need for extra check here.

 for (var i = min; i <= max; i+=0.5) {

/** * Generate our possible error scores */function generateErrorScores() {  var min = 0,    max = 100,    multiplier = 0.5,    list = [];  // Loop between min and max, increment by multiplier  for (var i = min; i <= max; i += 0.5) {    list.push(i);  }  return list;}console.log(generateErrorScores())

Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>