Try this:
// get adjustments for user
IEnumerable<Severity> existingSeverities =
from s in db.AdjusterPricingGrossLossSeverities
where s.type == type
&& s.adjusterID == adj.id
select new Severity
{
id = s.severity,
adjustment = s.adjustment.GetValueOrDefault().ToString("0.##"),
isT_E = (bool)s.isTimeAndExpense
};
-Edit-
I think that maybe you will need to have the Severity class have a Property that takes a double and saves a string to Severity.adjustment, like so:
Severity
{
//rest of class as normal
public double SetAdjustment
{
set { adjustment = value.ToString("0.00"); } }
}
}
-Edit, part 2-
// get adjustments for user
IEnumerable<Severity> existingSeverities =
from s in db.AdjusterPricingGrossLossSeverities
where s.type == type
&& s.adjusterID == adj.id
select new Severity
{
id = s.severity,
SetAdjustment = s.adjustment.GetValueOrDefault(),
isT_E = (bool)s.isTimeAndExpense
};
The rest of your code should not need to be changed, it should still use (Severity variable).adjustment as normal. This is just to get around the fact that there is not guaranteed way to translate .Net's Standard Numeric Format Strings into SQL's Convert, much less any custom formatting.