turning string numbers into doubles
Im trying to lift a number out of a string and turn it into a double. The first part is done, but I'm having some difficulties with the part after the '.'. I go over all chars in a for-loop. When I have checked it is a number and that the '.' has already passed, this piece of code should do the job:
prices is an arraylist of doubles, that is where I want to store the number. I want to overwrite the last number (the number I am reading) with the old number, including the new digit. check is a char, that is the character I am examining now in the string. When I devide that by 10, 100, 1000, and add that to the previous number, it should have one more digit at the end. However this doesn't happen. 52.0 still remain 52.0 after this code, even if for example char=='5'. The result should be 52.5 if char=='5'.
ps: while typing this I realise that this "(10*(devision+1)" is wrong, it should raise 10 to the power of devision+1.