KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am wondering what would be the best way (in the sense of safer and succinct) to convert from one nullable type to another "compatible" nullable type. Specifically, converting from decimal? to double? can be done using: public double? ConvertToNullableDouble(decimal? source) { return source.HasValue ? Convert.ToDouble(source) : (double?) null; } Is there any better way to do this? Maybe leveraging a standard conversion?
Tags (comma-separated)
Save Edits
Cancel