Fixed doubleToString function