It feels strange to me to be casting null to a type so I wanted to double check that this is the right way to do this:
decimal? d = data.isSpecified ? data.Value : (decimal?)null;
NOTE: I am marking the answer that suggests the method that I personally like the best:
decimal? d = data.isSpecified ? data.Value : default(decimal?)