Convert constant to integer if possible