Uses convertNumber to obtain a rational number for double constants. Additionally, improve error message if something goes wrong during conversion.