The correct format specifier of fscanf for double is %lf