I want to use Fisher Yates shuffle algorithm to shuffle each integer from Math.random()
after the ". (dot)". I split them into string and use the Fisher Yates shuffle algorithm but I am stuck on how to convert it back to number.
From: ["0", ".", "4", "1", "2", "7", "2", "9", "5", "8", "6", "7", "0", "7", "4", "2", "8", "1"]
To: 0.4127295867074281
var randomNum = Math.random();
var stringNum = randomNum.toString();
var stringArray = stringNum.split("");
var i = stringArray;
var j;
var temp;
while (--i > 1) {
j = Math.floor(Math.random() * (i + 1));
temp = stringArray[j];
stringArray[j] = stringArray[i];
stringArray[i] = temp;
}