Simply get the Value of value (if it HasValue) and apply whatever
rounding formula you desire to this (non-nullable) decimal.
For instance:
private decimal MyRound(decimal? v)
{
if (v.HasValue)
{
decimal d = v.Value;
return decimal.Round(d,0);
}
return 0;
}
Now do:
totalValue += MyRound(value);
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.