I'm trying to display values on website using
let chance = Math.pow(0.2, vict)*100;
The output gives dynamic value, and I need 0.16000000000000003% to show as 0.16% and 0.00025600000000000015% as 0.000256% and so on. How can I round it, so I'm not limited to fixed decimal number.
Edit: vict is a whole number at all times. I just need to remove the error as @Caltrop has stated in comments. chance
should display the probability. I cannot use suggested option with .toFixed, because as I said, I don't want to be limited to fixed decimal number in dynamic value.