[Solved] NumberFormatException error from reading a file


Ok, I think converting string into Integer and then typecasting it to double is causing the error. Why don’t you just convert the string to double.
Also you must trim the line while reading it to avoid any spaces.

    String holderStr = br.readLine().trim();
    System.out.println(holderStr);

    totalBalNum = Double.parseDouble(holderStr);

2

solved NumberFormatException error from reading a file