My goal is to add value pairs to a HashMap and if a value is already taken it will increment the previous value by .i. What I mean by this is it would start as 0.1 ... 0.9 then 0.10, 0.11, 0.12 and so on...
I have started:
for (int i=0; i < 50; i++){ Double test = Double.parseDouble( 0 + "." + i); But I cannot find a suitable test to add a decimal place onto the double once it has reached .9 (0.9, 0.10) Everything that I've tried doesn't work reliably. I was wondering if anyone could help.
inti?0.9 -> 0.10suggestsi = 0.1but0.10 -> 0.11suggestsi = 0.01. If your values actually are integers, i.e. 1 ... 9, 10, 11 etc., then please state so in your question - as well as why you prepend those with0..