seperate _convert_to_ctype function for double