I need to create a loop that can iterate with decimal, something like this:
$("#btn").click(function(){
for(i =parseFloat(0.00); i <= 2.00;i=parseFloat(i+0.05)){
$("#paragraph").append(i+"<br/>");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="button" id="btn" value="Create decimals" />
<p id="paragraph"></p>
But the result is not as expected, I need something like this:
- 0.02
- 0.04
- 0.06
- ....
- 1.04
- ....
- 1.99
- ....
- 2
Thanks for your help.