I can't seem to generate a random float number from 0.0 to 1.0 with Math.floor((Math.random() * 1.0) + 0.0);
Is there a workaround for that?
Math.random() as is will generate a random float number between 0.0 and 1.0.
Working example:
document.getElementById("generate").onclick = function() {
document.getElementById("random").value = Math.random();
};
<button id="generate">Generate random number</button>
<input id="random">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With